[Detector Support]: Yolo-NAS notebook from documentation fails to run with 404 error #14457
-
Describe the problem you are havingThe pretrained weights for YOLO-NAS are no longer available with a 404 error. The domain they are hosted under is for sale, so any automated attempts to download files from the model zoo will fail. This makes the documentation impossible to follow for OpenVino Yolo-NAS setup. Deci, the company behind the super-gradients library was acquired by Nvidia earlier this year. It's unclear whether the weights will be moved to a new location or whether the library will continue with the license it had. Version14 Frigate config file! pip install -q super_gradients==3.7.1
from super_gradients.common.object_names import Models
from super_gradients.conversion import DetectionOutputFormatMode
from super_gradients.training import models
model = models.get(Models.YOLO_NAS_S, pretrained_weights="coco")
# export the model for compatibility with Frigate
model.export("yolo_nas_s.onnx",
output_predictions_format=DetectionOutputFormatMode.FLAT_FORMAT,
max_predictions_per_image=20,
confidence_threshold=0.4,
input_image_shape=(320,320),
)
from google.colab import files
files.download('yolo_nas_s.onnx') docker-compose file or Docker CLI commandN/A Relevant Frigate log output[2024-10-20 13:16:58] INFO - crash_tips_setup.py - Crash tips is enabled. You can set your environment variable to CRASH_HANDLER=FALSE to disable it
[2024-10-20 13:17:09] INFO - utils.py - NumExpr defaulting to 2 threads.
[2024-10-20 13:17:17] WARNING - checkpoint_utils.py - :warning: The pre-trained models provided by SuperGradients may have their own licenses or terms and conditions derived from the dataset used for pre-training.
It is your responsibility to determine whether you have permission to use the models for your use case.
The model you have requested was pre-trained on the coco dataset, published under the following terms: https://cocodataset.org/#termsofuse
[2024-10-20 13:17:17] INFO - checkpoint_utils.py - License Notification: YOLO-NAS pre-trained weights are subjected to the specific license terms and conditions detailed in
https://github.com/Deci-AI/super-gradients/blob/master/LICENSE.YOLONAS.md
By downloading the pre-trained weight files you agree to comply with these terms.
Downloading: "https://sghub.deci.ai/models/yolo_nas_s_coco.pth" to /root/.cache/torch/hub/checkpoints/yolo_nas_s_coco.pth
---------------------------------------------------------------------------
HTTPError Traceback (most recent call last)
<ipython-input-1-c4c919ec4cd2> in <cell line: 2>()
1 from super_gradients.training import models
----> 2 model = models.get("yolo_nas_s", pretrained_weights="coco")
11 frames
/usr/lib/python3.10/urllib/request.py in http_error_default(self, req, fp, code, msg, hdrs)
641 class HTTPDefaultErrorHandler(BaseHandler):
642 def http_error_default(self, req, fp, code, msg, hdrs):
--> 643 raise HTTPError(req.full_url, code, msg, hdrs, fp)
644
645 class HTTPRedirectHandler(BaseHandler):
HTTPError: HTTP Error 404: Not Found Install methodHassOS Addon Object DetectorOpenVino Screenshots of the Frigate UI's System metrics pagesAny other information that may be helpfulNo response |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 2 replies
-
For this running into this, there is a temporary workaround. First you need to change the first line of the notebook to import from the latest github commit. ! pip install -U git+https://github.com/Deci-AI/super-gradients When you run it, you'll get an error about Index out of range referencing checkpoint_utils.py. From there, you'll need to edit checkpoint_utils.py to change line 1592 from to
|
Beta Was this translation helpful? Give feedback.
-
I changed the first step as you suggested, but instead of an error regarding checkpoint_utils.py, I get a dependency conflict error:
|
Beta Was this translation helpful? Give feedback.
-
And when running the second step, after changing the line in checkpoint_utils.py, I still get an index error:
|
Beta Was this translation helpful? Give feedback.
-
That usually means you need to restart the Runtime to get it to take the
changes to the environment. That's required anytime you change the cached
python files.
…On Thu, Oct 24, 2024 at 4:15 AM partytimeexcellent ***@***.***> wrote:
And when running the second step, after changing the line in
checkpoint_utils.py, I still get an index error:
[2024-10-24 08:13:17] WARNING - checkpoint_utils.py - :warning: The pre-trained models provided by SuperGradients may have their own licenses or terms and conditions derived from the dataset used for pre-training.
It is your responsibility to determine whether you have permission to use the models for your use case.
The model you have requested was pre-trained on the coco dataset, published under the following terms: https://cocodataset.org/#termsofuse
[2024-10-24 <https://cocodataset.org/#termsofuse[2024-10-24> 08:13:17] INFO - checkpoint_utils.py - License Notification: YOLO-NAS pre-trained weights are subjected to the specific license terms and conditions detailed in https://github.com/Deci-AI/super-gradients/blob/master/LICENSE.YOLONAS.md
By downloading the pre-trained weight files you agree to comply with these terms.
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
[<ipython-input-5-c847f4ac59f2>](https://localhost:8080/#) in <cell line: 5>()
3 from super_gradients.training import models
4
----> 5 model = models.get(Models.YOLO_NAS_S, pretrained_weights="coco")
3 frames
[/usr/local/lib/python3.10/dist-packages/super_gradients/training/utils/checkpoint_utils.py](https://localhost:8080/#) in load_pretrained_weights(model, architecture, pretrained_weights)
1590 pretrained_state_dict = torch.load(url.replace("file://", ""), map_location="cpu")
1591 else:
-> 1592 unique_filename = url.split("https://sg-hub-nv.s3.amazonaws.com/models/")[1].replace("/", "_").replace(" ", "_")
1593 map_location = torch.device("cpu")
1594 with wait_for_the_master(get_local_rank()):
IndexError: list index out of range
—
Reply to this email directly, view it on GitHub
<#14457 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAJCARMVYOOGOJBWMMLVH3Z5CUC7AVCNFSM6AAAAABQIQXJ46VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCMBTG44TGMQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
29/10/2024 work. Thx! |
Beta Was this translation helpful? Give feedback.
-
I'm getting a completely different error here than others. I've changed the line 1 endpoint, ran it, restarted the environment, then ran block 2:
If I rerun this block 2 with no other changes or steps being made/taken, the error will change?
I've tried resetting the environment by Runtime -> Disconnect and Delete Runtime but that doesn't seem to fix the issue. |
Beta Was this translation helpful? Give feedback.
For this running into this, there is a temporary workaround. First you need to change the first line of the notebook to import from the latest github commit.
! pip install -U git+https://github.com/Deci-AI/super-gradients
When you run it, you'll get an error about Index out of range referencing checkpoint_utils.py. From there, you'll need to edit checkpoint_utils.py to change line 1592 from
unique_filename = url.split("https://sghub.deci.ai/models/")[1].replace("/", "_").replace(" ", "_")
to
unique_filename = url.split("https://sg-hub-nv.s3.amazonaws.com/models/")[1].replace("/", "_").replace(" ", "_")