jwyang / fpn.pytorch

Pytorch implementation of Feature Pyramid Network (FPN) for Object Detection
MIT License
952 stars 221 forks source link

There was a bug when I continued to train the model. RuntimeError: Expected object of type torch.FloatTensor but found type torch.cuda.FloatTensor for argument #4 'other' #45

Open smileSJin opened 5 years ago

smileSJin commented 5 years ago

when i try to resume to train the model : RuntimeError: Expected object of type torch.FloatTensor but found type torch.cuda.FloatTensor for argument #4 'other'

smileSJin commented 5 years ago

I have sloved it, add this: if args.cuda: FPN.cuda() before the code(about line 290): if args.resume: load_name = os.path.join(outputdir, 'fpn{}{}{}.pth'.format(args.checksession, args.checkepoch, args.checkpoint))