deep-person-reid icon indicating copy to clipboard operation
deep-person-reid copied to clipboard

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

Open xperroni opened this issue 10 months ago • 1 comments

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

xperroni avatar Oct 20 '23 15:10 xperroni