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

input and target should be of same size #75

Open
vinhquang2050 opened this issue Dec 27, 2020 · 0 comments
Open

input and target should be of same size #75

vinhquang2050 opened this issue Dec 27, 2020 · 0 comments

Comments

@vinhquang2050
Copy link

Hi,

Im trying to run your code for training with CamVid Dataset (annotation from Segnet as guided) on Google Colab. The encoder works fine but I got error when training decoder with model loaded from previously trainned encoder.

/content/torch/install/bin/luajit: ...all/share/lua/5.1/cudnn/SpatialCrossEntropyCriterion.lua:28: input and target should be of same size
stack traceback:
[C]: in function 'assert'
...all/share/lua/5.1/cudnn/SpatialCrossEntropyCriterion.lua:28: in function 'forward'
./train.lua:101: in function 'opfunc'
/content/torch/install/share/lua/5.1/optim/adam.lua:37: in function 'adam'
./train.lua:116: in function 'train'
run.lua:59: in main chunk
[C]: in function 'dofile'
...tent/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: at 0x563cbe00b570

I have printed size of x, y and yt:
==> x: 10
3
360
480
[torch.LongStorage of size 4]

==> y: 10
12
360
480
[torch.LongStorage of size 4]

==> yt: 10
45
60
[torch.LongStorage of size 3]

Look likes y and yt are not same size in function err = loss:forward(y,yt) while running decoder.

Am I doing something wrong?

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

1 participant