Skip to content

input and target should be of same size #75

@vinhquang2050

Description

@vinhquang2050

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions