Closed mriamnobody closed 1 year ago
Hi @mriamnobody
It seems to be related to cudnn
and not SuperGradients
.
You can check out the following resources, it might help you;
Thank you @Louis-Dupont for providing the links/source to resolve an issue which is not related to super-gradients. I tried to perform the steps mentioned in the StackOverflow link and it got rid of the error Could not load library libcudnn_cnn_infer.so.8. Error: libcuda.so: cannot open shared object file: No such file or directory Aborted
the following errors were still present:
[2023-05-15 06:43:25] WARNING - __init__.py - Failed to import pytorch_quantization
[2023-05-15 06:43:25] WARNING - calibrator.py - Failed to import pytorch_quantization
[2023-05-15 06:43:25] WARNING - export.py - Failed to import pytorch_quantization
[2023-05-15 06:43:25] WARNING - selective_quantization_utils.py - Failed to import pytorch_quantization
So did some searching on internet and found that two more modules need to be installed:
nvidia-pyindex
and pytorch-quantization
. For anyone in future gets this issue, you first need to install the nvidia-pyindex
and then pytorch-quantization
else if you try to install pytorch-quantization
first and then nvidia-pyindex
you will the following error:
Collecting pytorch-quantization
Downloading pytorch-quantization-0.0.1.dev5.tar.gz (7.9 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [17 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-t9i6zekc/pytorch-quantization_9cb4035ffda345a7959b12c1917f5e0c/setup.py", line 150, in <module>
raise RuntimeError(open("ERROR.txt", "r").read())
RuntimeError:
###########################################################################################
The package you are trying to install is only a placeholder project on PyPI.org repository.
This package is hosted on NVIDIA Python Package Index.
This package can be installed as:
$ pip install nvidia-pyindex
$ pip install pytorch-quantization
```
###########################################################################################
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed
× Encountered error while generating package metadata. ╰─> See above for output.
note: This is an issue with the package mentioned above, not pip. hint: See above for details.
@Louis-Dupont I have still one query related to this problem after performing the steps unnecessary to resolve the issue I'm facing what shall be the output of this code:
import super_gradients
yolo_nas = super_gradients.training.models.get("yolo_nas_l", pretrained_weights="coco").cuda()
yolo_nas.predict("https://deci-pretrained-models.s3.amazonaws.com/sample_images/beatles-abbeyroad.jpg").show()
When the above code is run I only get the following on terminal:
The console stream is logged into /home/ethan/sg_logs/console.log
[2023-05-15 06:49:10] INFO - crash_tips_setup.py - Crash tips is enabled. You can set your environment variable to CRASH_HANDLER=FALSE to disable it
and it takes close to 25 seconds for the script to complete. Also, the load on GPU fluctuates from 10% to 100% while the script is running. Am I missing something?
Is this all the logs you had in the terminal? Because if its the first time you run, it makes sense it would take more time because it downloads the model, but you should have logs like:
Try rerunning it again after the model is downloaded it should be way faster.
Thanks for your reply @Louis-Dupont. Nothing is being displayed on my terminal except the text which I shared in my last comment. No model download progress bar nothing. I have attached a screenshot for your reference.
@Louis-Dupont
Let's see what takes time.
import time
import torch
start_predict = time.perf_counter()
from super_gradients.common.object_names import Models
from super_gradients.training import models
post_import_time = time.perf_counter()
print("Loading SG: ", post_import_time - start_predict)
# Note that currently only YoloX, PPYoloE and YOLO-NAS are supported.
model = models.get(Models.YOLO_NAS_L, pretrained_weights="coco")
# We want to use cuda if available to speed up inference.
model = model.to("cuda" if torch.cuda.is_available() else "cpu")
post_model_time = time.perf_counter()
print("Loading Model: ", post_model_time - post_import_time)
images_predictions = model.predict(
"../../../../documentation/source/images/examples/pose_elephant_flip.gif",
)
post_predict_time = time.perf_counter()
print("Predict: ", post_predict_time - post_model_time)
@Louis-Dupont, Below are the results of three consecutive runs. The script took close to 45 seconds to complete its execution. I have attached the console image for your reference.
I have used to following code for testing (available in documentation):
but I received the following error:
Environment: