- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was trying to run a classification sample with openvino:
python3 classification_sample_async.py -m public/googlenet-v3/FP32/googlenet-v3.xml -i banana.jpg -d GPU
and getting this error:
super().start_async(
RuntimeError: Exception from src/inference/src/cpp/infer_request.cpp:235:
Check 'is_dynamic || port.get_shape() == tensor->get_shape()' failed at src/inference/src/dev/isync_infer_request.cpp:277:
The input tensor size is not equal to the model input type: got [1,299,3,3] expecting [1,299,3,299].
I got the model in follwoing way:
omz_downloader --name googlenet-v3
omz_converter --name googlenet-v3
I am using openvino 2024.2.0 on Ubuntu 22.04
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi YogeshTyagi,
For your information, I am able to run Classification Python demo without having any import issue by running the demo in the directory, where the classification_demo.py script located.
e.g.
cd ~/Downloads/open_model_zoo/demos/classification_demo/python
python3 classification_demo.py -m googlenet-v3.xml -i image.jpg -d GPU
OR
python3 ~/Downloads/open_model_zoo/demos/classification_demo/python/classification_demo.py -m googlenet-v3.xml -i image.jpg -d GPU
You can have a look at the Line 26 and 27 of classification_demo.py script. The line 26 defines the path of the monitors.py script while the line 27 defines the path of the model_zoo folder.
Regards,
Peh
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi YogeshTyagi,
For your information, OpenVINO Image Classification Async Python Sample only validated with alexnet model. Since alexnet model is only available in OMZ 2023.3, you can download the alexnet model through the link below for your ease.
https://drive.google.com/drive/folders/1oiazRFPMVvQPseZxkR0-7kPmapWGTF_k?usp=sharing
To run classification demo with googlenet-v3 model, please use Classification Python Demo that available in open_model_zoo GitHub repository.
Regards,
Peh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, Peh.
I used googlenet-v3 model with Classification Python demo that you suggested. I installed openvino-model-api as well.
git clone https://github.com/openvinotoolkit/open_model_zoo.git
cd open_model_zoo/
git checkout 2024.2.0
cd ..
pip install open_model_zoo/demos/common/python
But got following error when running the sample:
python3 classification_demo.py -m public/googlenet-v3/FP32/googlenet-v3.xml -i banana.jpg -d GPU
ImportError: cannot import name 'Classification' from 'model_api.models'
I had to change following imports in classification_demo.py.
From this:
from model_api.models import Classification, OutputTransform
from model_api.performance_metrics import put_highlighted_text, PerformanceMetrics
from model_api.pipelines import get_user_config, AsyncPipeline
from model_api.adapters import create_core, OpenvinoAdapter, OVMSAdapter
To this:
from model_zoo.model_api.models import Classification, OutputTransform
from model_zoo.model_api.performance_metrics import put_highlighted_text, PerformanceMetrics
from model_zoo.model_api.pipelines import get_user_config, AsyncPipeline
from model_zoo.model_api.adapters import create_core, OpenvinoAdapter, OVMSAdapter
After that I got the error "No module named 'monitors'"
I had to "cd open_model_zoo/demos/common/python"
and run classification_demo.py from this path (because monitors.py exists at this path)
I did not expect to make such changes to run a sample app. Am I doing something wrong here?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi YogeshTyagi,
For your information, I am able to run Classification Python demo without having any import issue by running the demo in the directory, where the classification_demo.py script located.
e.g.
cd ~/Downloads/open_model_zoo/demos/classification_demo/python
python3 classification_demo.py -m googlenet-v3.xml -i image.jpg -d GPU
OR
python3 ~/Downloads/open_model_zoo/demos/classification_demo/python/classification_demo.py -m googlenet-v3.xml -i image.jpg -d GPU
You can have a look at the Line 26 and 27 of classification_demo.py script. The line 26 defines the path of the monitors.py script while the line 27 defines the path of the model_zoo folder.
Regards,
Peh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi YogeshTyagi,
This thread will no longer be monitored since this issue has been resolved. If you need any additional information from Intel, please submit a new question.
Regards,
Peh
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page