Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent shapes error #2

Open
seemababbasi opened this issue Apr 13, 2021 · 8 comments
Open

Inconsistent shapes error #2

seemababbasi opened this issue Apr 13, 2021 · 8 comments

Comments

@seemababbasi
Copy link

Dear Friend, you have done a nice work. I have a problem during training the model. The error is ValueError: Inconsistent shapes: saw (6272, 2, 1, 2, 18) but expected (6272, 2, 1, 18)
I have tried multiple times but failed to solve this problem.

error\

Regards
Seemab

@koushikkumarl
Copy link
Owner

@seemababbasi Please consider reshaping the output from first capsule network. Also, please let me know the input shape to know what could have been the issue.

@Asyeera
Copy link

Asyeera commented Dec 8, 2021

Hello there. I am very new to coding. I tried the code and obtained the same error.
image

code line:
routing_layer = CapsuleLayer(num_capsule=n_class,dim_vector=capsule_dim_size*2,num_routing=n_route,name='routing_layer_1')(primary_cap)

Looking forward for your guide. Thank you.

@laurajsantos
Copy link

The problem is the version of Keras and Tensorflow. I use Keras==2.2.0 and tensorflow 1 and it solved that error

@Lazy-Leopard
Copy link

Hello @laurajsantos can you please mention the specific version for tensorflow 1 even. Thanks in advance.

@Lazy-Leopard
Copy link

My error was resolved using the following imports on Google Colab

!pip install Keras==2.2.4
!pip install tensorflow==1.14.0
!pip install 'h5py==2.10.0' --force-reinstall

@maithregit123
Copy link

Hello bro please can you say how to run the folder

path = './ColonLungCancer' #Provide image path here!
a = PickleImages(PATH=path, IMAGE_SIZE=64) #Provide required image size
X_Data,Y_Data = a.load_dataset()

IF I RUN THE FOLDER WHICH IS SAVED ON DESKTOP IAM GETTING :

Reading Dataset from Pickle Object

BUT THE SIZE:

(0,)
(0,)

@aditiviru
Copy link

Which python version is needed in order to install above mentioned Keras and Tensorflow versions?
installing this in google colab is not working because tensorflow 1 is not supported there. i am trying in conda virtual environment. I tried with 3.6.5 and 3.8.5

@aditiviru
Copy link

In 3.6.5 - tensorflow got installed, but unable to import cv2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants