GithubHelp home page GithubHelp logo

Comments (13)

AfsahS avatar AfsahS commented on July 25, 2024 1

TypeError: deconv_length() missing 1 required positional argument: 'output_padding'.. This issue can be solved using keras=2.1.6 with python 3.6.x

from segcaps.

nithinivi avatar nithinivi commented on July 25, 2024 1

TypeError: deconv_length() missing 1 required positional argument: 'output_padding'.. This issue can be solved using keras=2.1.6 with python 3.6.x

If using the latest version of Keras please use output_padding=None, this seems to solve the issue

from segcaps.

hiteshnitetc avatar hiteshnitetc commented on July 25, 2024

Another problem is: "Too many indices for array, skipping files " , with 10 images and mask. but when i load MSCOCO data set with 10 images and mask it working.

from segcaps.

Cheng-Lin-Li avatar Cheng-Lin-Li commented on July 25, 2024

Hi hiteshnitetc,

How many channels in your mask image? It should be only one channel as gray scale images.

from segcaps.

hiteshnitetc avatar hiteshnitetc commented on July 25, 2024

@Cheng-Lin-Li Hello, yes my mask images are gray scale only, with channel 1, and keras is set to channel last topology

from segcaps.

AfsahS avatar AfsahS commented on July 25, 2024

I have same issue, code works fine with MSCOCO dataset, but have same error with different datasets.

from segcaps.

fenaux avatar fenaux commented on July 25, 2024

Hello,
I get the same issue
My configuration is : ubuntu 18.04.2, Python 3.6.7, Keras 2.2.4

The data were obtained with
python3 getcoco17.py --data_root_dir ../data --category person --annotation_file ../data/annotations/instances_train2017.json --number 10 --id 22228 178040 167494 144599 13800 147865 279422 477861 123512 69578

And then I run
python3 ./main.py --test --Kfold 2 --net segcapsr3 --data_root_dir=data --loglevel 2 --which_gpus=-2 --gpus=0 --dataset mscoco17 --weights_path data/saved_models/segcapsr3/split-0_batch-1_shuff-1_aug-0_loss-dice_slic-1_sub--1_strid-1_lr-0.0001_recon-20.0_model_20180705-092846.hdf5

thanks for your help

from segcaps.

fenaux avatar fenaux commented on July 25, 2024

Extract from
documentation of deconv_length line 148 and 149
https://github.com/keras-team/keras/blob/master/keras/utils/conv_utils.py
output_padding: Integer, amount of padding along the output dimension,
Can be set to None in which case the output length is inferred

Then I introduced the following modifications in "capsule_layers.py"
ddition on line 250 output_padding = None
New 251 (was 250) out_height = deconv_length(self.input_height, self.scaling, self.kernel_size, self.padding, output_padding)
New 252 (was 252) out_width = deconv_length(self.input_width, self.scaling, self.kernel_size, self.padding, output_padding)

addition on line 284 output_padding = None
new 285 (was 283) output_shape[1] = deconv_length(output_shape[1], self.scaling, self.kernel_size, self.padding, output_padding)
new 286 (was 284) output_shape[2] = deconv_length(output_shape[2], self.scaling, self.kernel_size, self.padding, output_padding)

and it seems it works. I get 5 output masks
But I now have an other issue : "Unable to find weights path. Testing with random weights".

from segcaps.

fenaux avatar fenaux commented on July 25, 2024

I found the solution :
In test.py
Line 109 weights_path = join(args.data_root_dir, args.weights_path)
then data should not be repeated in weight_path => command line modified accordingly
python3 ./main.py --test --Kfold 2 --net segcapsr3 --data_root_dir=data --loglevel 2 --which_gpus=-2 --gpus=0 --dataset mscoco17 --weights_path saved_models/segcapsr3/split-0_batch-1_shuff-1_aug-0_loss-dice_slic-1_sub--1_strid-1_lr-0.0001_recon-20.0_model_20180705-092846.hdf5

from segcaps.

hiteshnitetc avatar hiteshnitetc commented on July 25, 2024

from segcaps.

Cheng-Lin-Li avatar Cheng-Lin-Li commented on July 25, 2024

Hi fenaux,

Thanks for your findings and suggestions.
I will revise the document and code accordingly.

from segcaps.

tanchaozhen avatar tanchaozhen commented on July 25, 2024

I get the same issue.
I solved the first problem "deconv_length() missing " using keras=2.1.6 with python 3.6.x.
But,"Too many indices for array, skipping files" still cannot be solved. Have you solved it?

from segcaps.

hiteshnitetc avatar hiteshnitetc commented on July 25, 2024

Getting following error.

INFO 2020-12-25 19:49:37,131: 
path_to_np=data/np_files/train18.npz
INFO 2020-12-25 19:49:37,132: 
Pre-made numpy array not found for train18.
Creating now...
DEBUG 2020-12-25 19:49:37,132: STREAM b'IHDR' 16 13
DEBUG 2020-12-25 19:49:37,132: STREAM b'IDAT' 41 32768

----------------------------------------------------------------------------------------------------
Unable to load img or masks for train18
too many indices for array: array is 2-dimensional, but 3 were indexed
Skipping file

from segcaps.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.