Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

train error: grad is being used in an in-place operation #196

Open
Sylvia-Vee opened this issue Mar 12, 2021 · 5 comments
Open

train error: grad is being used in an in-place operation #196

Sylvia-Vee opened this issue Mar 12, 2021 · 5 comments

Comments

@Sylvia-Vee
Copy link

Hi
excuse to ask you a question:

File "/home/czhan14x/train_project/ScaledYOLOv4/models/yolo.py", line 141, in _initialize_biases
b[:, 4] += math.log(8 / (640 / s) ** 2) # obj (8 objects per 640 image)
RuntimeError: a view of a leaf Variable that requires grad is being used in an in-place operation.

this error occurred while I train yolov4-large model in GeForce RTX 3090TI, but It's Ok in Titan RTX, I don't know why?
torch: 1.8.0+cu111
torchvision: 0.9.0+cu111

@FreeworkEarth
Copy link

Same error. Even on Colab

@FreeworkEarth
Copy link

FreeworkEarth commented Mar 12, 2021

Applying the follwing lines in the beginning of my Colab notebook fixed the problem, use the versions below and it should be able to train

!pip uninstall torch
!pip uninstall torch # run this command twice
!pip install torch==1.7.0+cu110 torchvision==0.8.1+cu110 torchtext==0.8 torchaudio===0.7.0 -f https://download.pytorch.org/whl/torch_stable.htmly

@Duarte-Nunes
Copy link

I gotta ask, is models/yolo.py even used in any other files of the repository?

@Sylvia-Vee
Copy link
Author

I gotta ask, is models/yolo.py even used in any other files of the repository?

no, only this process

@Sylvia-Vee
Copy link
Author

Applying the follwing lines in the beginning of my Colab notebook fixed the problem, use the versions below and it should be able to train

!pip uninstall torch
!pip uninstall torch # run this command twice
!pip install torch==1.7.0+cu110 torchvision==0.8.1+cu110 torchtext==0.8 torchaudio===0.7.0 -f https://download.pytorch.org/whl/torch_stable.htmly

Thanks, It works for me too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants