You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the code does not run with a custom model. it throws this error: ` File "predict.py", line 127, in predict
predictor()
File "/Users/iosph/miniforge3/envs/ml/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "/Users/iosph/Documents/FireDetectionYOLOv8/ultralytics/yolo/engine/predictor.py", line 164, in call
model = self.model if self.done_setup else self.setup(source, model)
File "/Users/iosph/Documents/FireDetectionYOLOv8/ultralytics/yolo/engine/predictor.py", line 121, in setup
model = AutoBackend(model, device=device, dnn=self.args.dnn, fp16=self.args.half)
File "/Users/iosph/Documents/FireDetectionYOLOv8/ultralytics/nn/autobackend.py", line 73, in init
model = attempt_load_weights(weights if isinstance(weights, list) else w,
File "/Users/iosph/Documents/FireDetectionYOLOv8/ultralytics/nn/tasks.py", line 303, in attempt_load_weights
ckpt = torch.load(attempt_download(w), map_location='cpu') # load
File "/Users/iosph/miniforge3/envs/ml/lib/python3.8/site-packages/torch/serialization.py", line 712, in load
return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
File "/Users/iosph/miniforge3/envs/ml/lib/python3.8/site-packages/torch/serialization.py", line 1049, in _load
result = unpickler.load()
File "/Users/iosph/miniforge3/envs/ml/lib/python3.8/site-packages/torch/serialization.py", line 1042, in find_class
return super().find_class(mod_name, name)
AttributeError: Can't get attribute 'IterableSimpleNamespace' on <module 'ultralytics.yolo.utils' from '/Users/iosph/Documents/FireDetectionYOLOv8/ultralytics/yolo/utils/init.py'>
Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.`
The text was updated successfully, but these errors were encountered:
Hi @netrosec ,
The error occurs when trying to load the weights for the custom model. Specifically, it's failing to deserialize the model weights due to an AttributeError involving IterableSimpleNamespace.
If it doesnt work please do try:
-Try re-downloading the model weights using the attempt_download function.
-Ensure that the custom model is compatible with the YOLOv8 framework.
the code does not run with a custom model. it throws this error: ` File "predict.py", line 127, in predict
predictor()
File "/Users/iosph/miniforge3/envs/ml/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "/Users/iosph/Documents/FireDetectionYOLOv8/ultralytics/yolo/engine/predictor.py", line 164, in call
model = self.model if self.done_setup else self.setup(source, model)
File "/Users/iosph/Documents/FireDetectionYOLOv8/ultralytics/yolo/engine/predictor.py", line 121, in setup
model = AutoBackend(model, device=device, dnn=self.args.dnn, fp16=self.args.half)
File "/Users/iosph/Documents/FireDetectionYOLOv8/ultralytics/nn/autobackend.py", line 73, in init
model = attempt_load_weights(weights if isinstance(weights, list) else w,
File "/Users/iosph/Documents/FireDetectionYOLOv8/ultralytics/nn/tasks.py", line 303, in attempt_load_weights
ckpt = torch.load(attempt_download(w), map_location='cpu') # load
File "/Users/iosph/miniforge3/envs/ml/lib/python3.8/site-packages/torch/serialization.py", line 712, in load
return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
File "/Users/iosph/miniforge3/envs/ml/lib/python3.8/site-packages/torch/serialization.py", line 1049, in _load
result = unpickler.load()
File "/Users/iosph/miniforge3/envs/ml/lib/python3.8/site-packages/torch/serialization.py", line 1042, in find_class
return super().find_class(mod_name, name)
AttributeError: Can't get attribute 'IterableSimpleNamespace' on <module 'ultralytics.yolo.utils' from '/Users/iosph/Documents/FireDetectionYOLOv8/ultralytics/yolo/utils/init.py'>
Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.`
The text was updated successfully, but these errors were encountered: