Code Monkey home page Code Monkey logo

Comments (2)

RenMao1314 avatar RenMao1314 commented on September 26, 2024

Hi, this code in repo is implemented by <pytorch 1.0, so some code in old version pytorch(such as pytorch 0.4) have been deprecated, you should change your code by using pytorch 1.0

From point 1-3 you're right, but for point 4 is not exactly right, you should change as below:
original:
images = Variable(images,volatile=True)
change to:
with torch.no_grad():
images = Variable(image)
Only this can you change directly, for ' images.detach()', after you define you variable and feed into your network, and then you don't want to optimize the variable while backward, so you need to detach this variable, and it will happen on evaluation not train, like this way:

#use it during the evaluation
output = model(input)
image = Variable(images)
image.detach()

In conclusion, after you change all code(upon all is just UserWarning, not error), you should run your network fluently, but if you can not get your expected result, please double check you dataloader or hyperparameter, thanks.

from pytorch-yolo-v1.

zkchen95 avatar zkchen95 commented on September 26, 2024

after torch0.4, volatile=true was deprecated, you should try 'with torch.no_grad()', or just reduce your batch_size, but it's just not use best of your memory

from pytorch-yolo-v1.

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.