Git Product home page Git Product logo

Comments (4)

qinnzou avatar qinnzou commented on May 24, 2024

The releaased code is running on Pytorch0.4.0. If adapted to Pytorch1.1.0 or above, optimizer.step()' should be before lr_scheduler.step()'.
For the problem of out of memory, you may have to set a smaller batch size.

from robust-lane-detection.

peterlee909 avatar peterlee909 commented on May 24, 2024

Thank you for your answer.
I have set the batch size to 3, but it still didn't work.
It really confused me that a 16GB GPU was out of memory.
As I know, Pytorch won't take multi-GPU itself.
Can you please tell me how did you do that?
Thank you so much!

from robust-lane-detection.

peterlee909 avatar peterlee909 commented on May 24, 2024

I found I forgot to resize the image causing to the memory problem.
However, I face another problem.

Traceback (most recent call last):
File "c:/Users/10806337/Desktop/PortableGit/Projects/Robust-Lane-Detection/LaneDetectionCode/train.py", line 122, in
train(args, epoch, model, train_loader, device, optimizer, criterion)
File "c:/Users/10806337/Desktop/PortableGit/Projects/Robust-Lane-Detection/LaneDetectionCode/train.py", line 21, in train
loss.backward()
File "C:\Users\10806337.conda\envs\RobustLaneDetection\lib\site-packages\torch\tensor.py", line 118, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph)
File "C:\Users\10806337.conda\envs\RobustLaneDetection\lib\site-packages\torch\autograd_init_.py", line 93, in backward
allow_unreachable=True) # allow_unreachable flag
RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn

Do you have any idea of it?

from robust-lane-detection.

peterlee909 avatar peterlee909 commented on May 24, 2024

I have solved my problem.
I accidentally add torch.no_grad(): before the training loop.
But I found one bug in the code that is in train():
loss = criterion(output, target)
should be
loss = criterion(output[0], target)

from robust-lane-detection.

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.