Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing packages when trying to export models to ONNX from Docker container #559

Open
xperroni opened this issue Oct 20, 2023 · 1 comment

Comments

@xperroni
Copy link

Running the tools/export.py script from the Docker container fails due to missing Python packages.

For example, running:

python tools/export.py --weights osnet_x0_25_imagenet.pth --include onnx --imgsz 256 128

Fails with error:

Traceback (most recent call last):
  File "tools/export.py", line 7, in <module>
    import pandas as pd
ModuleNotFoundError: No module named 'pandas'

After installing pandas the same call fails with error:

export failure: No module named 'onnx'
Traceback (most recent call last):
  File "tools/export.py", line 200, in <module>
    f = export_onnx(extractor.model.eval(), im, args.weights, 12, train=False, dynamic=args.dynamic, simplify=True)  # opset 12
  File "tools/export.py", line 98, in export_onnx
    return f
UnboundLocalError: local variable 'f' referenced before assignment

After going through a few turns of this, I eventually found the complete list of missing packages. They can be installed with:

pip install pandas onnx==1.8.0 onnxsim onnxruntime
@bmmtstb
Copy link

bmmtstb commented Oct 30, 2023

I know that I had the same issues while using pip install torchreid without docker. But I solved it similarly.

The following code in the requirements.txt is commented out:

# Export --------------------------------------
# onnx
# onnx-simplified
# openvino-dev
# openvino2tensorflow
# tensorflow
# tensorflow_datasets

Is that the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants