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

ValueError when using own dataset #116

Open
SpencerTrihus opened this issue Oct 22, 2019 · 2 comments
Open

ValueError when using own dataset #116

SpencerTrihus opened this issue Oct 22, 2019 · 2 comments

Comments

@SpencerTrihus
Copy link

Hi,

I am trying to train ICNet on my own dataset using the cityscapes model as a starting point, but when I run train.py I receive the error:

ValueError: Dimension 3 in both shapes must be equal, but are 64 and 32. Shapes are [3,3,3,64] and [3,3,3,32]. for 'conv1_1_3x3_s2_2/Assign' (op: 'Assign') with input shapes: [3,3,3,64], [3,3,3,32].

My dataset only has 1 object (2 if background included). This seems similar to issue #20 and #50, but I am not familiar with how to change the number of classes so that there is no discrepancy. I have updated config.py to indicate 2 object classes, but it seems there are other files that must be modified.

Thanks for your help!

@SpencerTrihus
Copy link
Author

UPDATE:

I have resolved the above issue occuring in conv1 by changing the input image size of my dataset in utils/config.py.

Now I receive the issue described in #50 as the following:

ValueError: Dimension 3 in both shapes must be equal, but are 2 and 19. Shapes are [1,1,128,2] and [1,1,128,19]. for 'conv6_cls_2/Assign' (op: 'Assign') with input shapes: [1,1,128,2], [1,1,128,19].

Could you explain how to resolve this issue? I have changed config.py so that it indicates there are 2 classes, and I have replaced

restore_var = tf.global_variables()

with

restore_var = [v for v in tf.global_variables() if 'conv6_cls' not in v.name.

What else do I need to do to fix this problem?

Thanks!

@songshan0321
Copy link

Facing the same issue after doing the same thing as you, did u solve this?? Thanks

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

2 participants