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

AttributeError: 'Tensor' object has no attribute 'tensor_split' #7085

Closed
1 task done
1JAEWOOCHOI1 opened this issue Mar 21, 2022 · 14 comments · Fixed by #7074 or #7102
Closed
1 task done

AttributeError: 'Tensor' object has no attribute 'tensor_split' #7085

1JAEWOOCHOI1 opened this issue Mar 21, 2022 · 14 comments · Fixed by #7074 or #7102
Labels
question Further information is requested

Comments

@1JAEWOOCHOI1
Copy link

Search before asking

Question

train.py을 사용하는 중
AttributeError: 'Tensor' object has no attribute 'tensor_split'
문제가 발생했습니다.
하지만 이것을 해결할 실력이 되질 않습니다
화면 캡처 2022-03-22 004744

Additional

No response

@1JAEWOOCHOI1 1JAEWOOCHOI1 added the question Further information is requested label Mar 21, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Mar 21, 2022

👋 Hello @1JAEWOOCHOI1, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.

If this is a 🐛 Bug Report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available.

For business inquiries or professional support requests please visit https://ultralytics.com or email support@ultralytics.com.

Requirements

Python>=3.7.0 with all requirements.txt installed including PyTorch>=1.7. To get started:

git clone https://github.com/ultralytics/yolov5  # clone
cd yolov5
pip install -r requirements.txt  # install

Environments

YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

CI CPU testing

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), validation (val.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit.

@glenn-jocher
Copy link
Member

@1JAEWOOCHOI1 good news 😃! Your original issue may now be fixed ✅ in PR #7074. To receive this update:

  • Gitgit pull from within your yolov5/ directory or git clone https://github.com/ultralytics/yolov5 again
  • PyTorch Hub – Force-reload model = torch.hub.load('ultralytics/yolov5', 'yolov5s', force_reload=True)
  • Notebooks – View updated notebooks Open In Colab Open In Kaggle
  • Dockersudo docker pull ultralytics/yolov5:latest to update your image Docker Pulls

Thank you for spotting this issue and informing us of the problem. Please let us know if this update resolves the issue for you, and feel free to inform us of any other issues you discover or feature requests that come to mind. Happy trainings with YOLOv5 🚀!

@1JAEWOOCHOI1
Copy link
Author

다시 시도해보고 있는데 아직 해결을 하지 못했습니다.

@glenn-jocher
Copy link
Member

@1JAEWOOCHOI1 #7074 resolves your original issue. You need to update your code per the above instructions.

@marvision-ai
Copy link

Hi @glenn-jocher

I have updated the repo with the PR but still run into the same problem.
image

@kimkihoon0515
Copy link

kimkihoon0515 commented Mar 22, 2022

image

@glenn-jocher
Ya same for me. Just updated the repo by using git pull but still problem not fixed

@glenn-jocher
Copy link
Member

glenn-jocher commented Mar 22, 2022

@marvision-ai @kimkihoon0515 oh interesting. This is in the loss function rather than the model itself. Maybe torch.Tensor.tensor_split() was only introduced recently. What version of torch are you guys using?

@kimkihoon0515
Copy link

@glenn-jocher I'm using 1.7.1
image

@glenn-jocher
Copy link
Member

@marvision-ai @kimkihoon0515 it looks like torch.Tensor.tensor_split was first introduced in torch 1.8.0:
https://pytorch.org/docs/1.8.0/tensors.html?highlight=tensor_split#torch.Tensor.tensor_split

Since our requirements are torch>=1.7.0 we have a problem now... let me think about this

@kimkihoon0515
Copy link

kimkihoon0515 commented Mar 22, 2022

@glenn-jocher should i upgrade my torch above to 1.8.0??

@glenn-jocher
Copy link
Member

@kimkihoon0515 yes if you upgrade the problem will be solved. I need to figure out if I can replace tensor_split with something 1.7.0 compatible though for everyone else, otherwise I'll have to raise the YOLOv5 requirements to 1.8.0, which we probably want to avoid.

@kimkihoon0515
Copy link

@glenn-jocher which version of torch and cuDNN u use? i just upgraded my torch and seems the cuDNN version doesn't match with my torch ver

@glenn-jocher
Copy link
Member

@glenn-jocher
Copy link
Member

@kimkihoon0515 @marvision-ai good news 😃! Your original issue may now be fixed ✅ in PR #7102. To receive this update:

  • Gitgit pull from within your yolov5/ directory or git clone https://github.com/ultralytics/yolov5 again
  • PyTorch Hub – Force-reload model = torch.hub.load('ultralytics/yolov5', 'yolov5s', force_reload=True)
  • Notebooks – View updated notebooks Open In Colab Open In Kaggle
  • Dockersudo docker pull ultralytics/yolov5:latest to update your image Docker Pulls

Thank you for spotting this issue and informing us of the problem. Please let us know if this update resolves the issue for you, and feel free to inform us of any other issues you discover or feature requests that come to mind. Happy trainings with YOLOv5 🚀!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
4 participants