-
-
Notifications
You must be signed in to change notification settings - Fork 16.9k
Issue with Tellu Organoid Classifier using Yolov5 #13539
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
Comments
👋 Hello @djtigani, thank you for reaching out and for using YOLOv5 🚀! It seems you're encountering an issue with your Tellu Intestinal Organoid Classifier setup. To assist further, could you please provide a minimum reproducible example (MRE)? This will help us debug the issue more effectively. Specifically, please include:
In the meantime, here are a few resources and steps that may help: RequirementsEnsure your environment meets the following:
To set up, run: git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install Common Troubleshooting
EnvironmentsYOLOv5 is verified to work in environments like:
StatusCheck if all YOLOv5 CI tests are passing: If this badge is green, YOLOv5 tests for training, validation, inference, export, and benchmarks are all passing on macOS, Windows, and Ubuntu. This is an automated response to help guide you. A member of the Ultralytics team will review your issue and assist you further as soon as possible. Thanks for your patience! 😊 |
@djtigani this error occurs due to PyTorch 2.6's new security restrictions in
!git pull # in your yolov5 directory
!pip install torch==2.0.1 # compatible version
For full Google Colab setup guidance, see our Training custom datasets with Ultralytics YOLOv8 in Google Colab guide which covers similar environment configuration steps. Let us know if you still encounter issues after trying these solutions! 🚀 |
@pderrenger Hi! thank for the advice. Where should I run the code provided in the googlecolab (https://colab.research.google.com/drive/1j-jutA52LlPuB4WGBDaoAhimqXC3xguX?usp=sharing) I tried running it after 1.2 and then got this result: You are not currently on a branch.
Collecting torch==2.0.1 when I restart the session i am unable to run Tellu (step 3) python3: can't open file '/content/detect.py': [Errno 2] No such file or directory |
To resolve the PyTorch version conflict and missing detect.py error in Google Colab, follow these steps:
!git clone https://github.com/ultralytics/yolov5 # clone repo
%cd yolov5 # enter directory
!pip install -qr requirements.txt # install dependencies
!python detect.py --weights /content/yolov5/TelluWeights.pt --conf 0.35 --source /content/your/source/dir This maintains PyTorch 2.6 compatibility while ensuring proper file paths. For Colab environment setup guidance, see our Training custom datasets in Google Colab guide. Let me know if issues persist! 🚀 |
Search before asking
Question
I am having this issue with Tellu Intestinal Organoid Classifier https://colab.research.google.com/drive/1j-jutA52LlPuB4WGBDaoAhimqXC3xguX?usp=sharing
Has worked perfectly before, but know I cannot get this code to run. any help would be appreciated, thanks.
detect: weights=['/content/yolov5/TelluWeights.pt'], source=/content/drive/MyDrive/BlatchleyLab/Projects/Role_of_integrins_in_symmetry_breaking/241217_DJT_SC_Rac1i_p30/D4, data=data/coco128.yaml, imgsz=[640, 640], conf_thres=0.35, iou_thres=0.45, max_det=1000, device=, view_img=False, save_txt=True, save_conf=True, save_crop=False, nosave=False, classes=None, agnostic_nms=False, augment=False, visualize=False, update=False, project=runs/detect, name=D4, exist_ok=False, line_thickness=3, hide_labels=True, hide_conf=False, half=False, dnn=False, vid_stride=1
YOLOv5 🚀 v7.0-0-g915bbf29 Python-3.11.11 torch-2.6.0+cu124 CPU
Traceback (most recent call last):
File "/content/yolov5/detect.py", line 259, in
main(opt)
File "/content/yolov5/detect.py", line 254, in main
run(**vars(opt))
File "/usr/local/lib/python3.11/dist-packages/torch/utils/_contextlib.py", line 116, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/content/yolov5/detect.py", line 96, in run
model = DetectMultiBackend(weights, device=device, dnn=dnn, data=data, fp16=half)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/content/yolov5/models/common.py", line 345, in init
model = attempt_load(weights if isinstance(weights, list) else w, device=device, inplace=True, fuse=fuse)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/content/yolov5/models/experimental.py", line 79, in attempt_load
ckpt = torch.load(attempt_download(w), map_location='cpu') # load
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/torch/serialization.py", line 1470, in load
raise pickle.UnpicklingError(_get_wo_message(str(e))) from None
_pickle.UnpicklingError: Weights only load failed. This file can still be loaded, to do so you have two options, do those steps only if you trust the source of the checkpoint.
(1) In PyTorch 2.6, we changed the default value of the
weights_only
argument intorch.load
fromFalse
toTrue
. Re-runningtorch.load
withweights_only
set toFalse
will likely succeed, but it can result in arbitrary code execution. Do it only if you got the file from a trusted source.(2) Alternatively, to load with
weights_only=True
please check the recommended steps in the following error message.WeightsUnpickler error: Unsupported global: GLOBAL models.yolo.Model was not an allowed global by default. Please use
torch.serialization.add_safe_globals([Model])
or thetorch.serialization.safe_globals([Model])
context manager to allowlist this global if you trust this class/function.Check the documentation of torch.load to learn more about types accepted by default with weights_only https://pytorch.org/docs/stable/generated/torch.load.html.
\nThe script also accepts other parameters. See https://github.com/ultralytics/yolov5/blob/master/detect.py for all the options.\n --max-detect 1000. Default is 1000; if you require more, add the parameter to the line of code above with a different value.\n --hide-labels Adding this parameter will hide the name of the organoid class detected in the result images. Convenient in dense cultures and for publication purposes\n\nExample:\n!python detect.py --weights $tellu --conf 0.35 --source $dir --save-txt --save-conf --name "results" --hide-labels --max-detect 2000\n
Additional
No response
The text was updated successfully, but these errors were encountered: