Giter Club home page Giter Club logo

Comments (6)

ne7ermore avatar ne7ermore commented on August 11, 2024

make sure the labels` data type is torch.cuda.LongTensor
i saw your log that something wrong in the labels' datatype (torch.cuda.IntTensor)

File "D:/github/torch_light/Image-Cap/train.py", line 235, in
target, _ = actor(hidden, labels)

from torch-light.

arixlin avatar arixlin commented on August 11, 2024

@ne7ermore
hi, I don't modify Image-Cap/train.py, i saw return labels is int list.
thx!

from torch-light.

ne7ermore avatar ne7ermore commented on August 11, 2024

what did you get from the data_loader. Data_loader
try to get the labels` datatype form this line below i show

https://github.com/ne7ermore/torch_light/blob/master/Image-Cap/data_loader.py#L41

or you can try this simple test code: https://github.com/ne7ermore/torch_light/blob/master/Image-Cap/data_loader.py#L58

img, labels = next(training_data) from https://github.com/ne7ermore/torch_light/blob/master/Image-Cap/data_loader.py#L66
print(labels)

from torch-light.

arixlin avatar arixlin commented on August 11, 2024

@ne7ermore
Hi, when I run Image-Cap/data_loader.py, labels is [torch.cuda.IntTensor of size 2x16 (GPU 0)], Image-Cap/train.py#115 labels is [torch.cuda.IntTensor of size 32x17 (GPU 0)]
thx!

from torch-light.

ne7ermore avatar ne7ermore commented on August 11, 2024

I guess sth change between pytorch`s versions
my version is 0.3.1
and i have added long() function to change the datatype of labels

https://github.com/ne7ermore/torch_light/blob/master/Image-Cap/data_loader.py#L46

please try again :)

if found error again, show the pytorch's version which you used

from torch-light.

arixlin avatar arixlin commented on August 11, 2024

@ne7ermore
Thank you so much, it works out! train.py has been running!

from torch-light.

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.