Repository navigation
Replies: 1 comment
|
@msmiatac The key part of the error is: Since the same script works on other machines, I'd first suspect an environment difference rather than an issue with the YOLO model itself. A few things to check:
One question that would help narrow it down:
If the failing machine doesn't list the PyTorch frontend, then the issue is likely an incomplete or mismatched OpenVINO installation rather than anything specific to Ultralytics or your conversion script. If this solves your problem, feel free to mark it as the accepted answer so others can find it easily. |
Uh oh!
There was an error while loading. Please reload this page.
When running a script to convert the YoloV8 model from Ultralytics (https://huggingface.co/Ultralytics/YOLOv8/resolve/main/yolov8n.pt), I encounter the following error on one of the machines:
OpenVINO: export failure ❌ 10.8s: Check 'false' failed at src/frontends/common/src/manager.cpp:64:
FrontEnd API failed with InitializationFailure:
FrontEnd for Framework pytorch is not found
However, on other machines with seemingly identical configurations, the conversion completes successfully. Has anyone encountered this issue or have any suggestions on how to resolve it?
Here is the conversion script:
#!/bin/bash
#Set the name of the virtual environment directory
VENV_DIR="yolo_venv"
#Create a Python virtual environment if it doesn't exist
if [ ! -d "$VENV_DIR" ]; then
echo "Creating virtual environment in $VENV_DIR..."
python3 -m venv "$VENV_DIR"
fi
#Activate the virtual environment
source "$VENV_DIR/bin/activate"
#Upgrade pip in the virtual environment
pip install --upgrade pip
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
pip install openvino
pip install ultralytics
#Function to export YOLO model
export_yolo_model() {
local weights_path=$1 # User-provided weights path
import sys
from ultralytics import YOLO
import openvino
weights_path = sys.argv[1]
model_type = "YOLOv8"
try:
model = YOLO(weights_path)
model.info()
converted_path = model.export(format='openvino')
except Exception as e:
print(f"An error occurred during model conversion: {e}")
EOF
}
#Check if a weights path is provided as an argument
if [ $# -eq 0 ]; then
echo "Usage: $0 <path_to_weights_file>"
exit 1
fi
#Call the function with the user-provided weights path
export_yolo_model "$1"
All reactions