I am unable to run examples/cpp/hello_world/main.cpp after compilation using torchvision 0.8.2 with libtorch 1.7.1.
I encountered this in a CI run when trying to update libtorch and torchvision on Homebrew: https://github.com/Homebrew/homebrew-core/pull/66688
The test attempts to compile and run the example mentioned above. It produced this error:
==> /usr/bin/clang++ -std=c++14 main.cpp -o test -I/usr/local/opt/libtorch/include -I/usr/local/opt/libtorch/include/torch/csrc/api/include -L/usr/local/opt/libtorch/lib -ltorch -ltorch_cpu -lc10 -L/usr/local/Cellar/torchvision/0.8.2/lib -ltorchvision
==> ./test
dyld: Library not loaded: /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/Python
Referenced from: /usr/local/opt/torchvision/lib/libtorchvision.dylib
Reason: image not found
Error: torchvision: failed
This was the same test used with previous versions of torchvision in Homebrew CI. I'm trying to reproduce the error locally, but libtorch is taking ages to compile on my woefully underpowered laptop.
Steps to reproduce the behavior:
brew test torchvisionCI run logs available here: https://github.com/Homebrew/homebrew-core/pull/66688/checks?check_run_id=1535220352
No errors.
conda, pip, source): brew install --build-from-sourcecmake. Exact commands can be found below.None.
Ok, things finally finished compiling. I'm unable to reproduce the error locally. Apologies for cluttering your issue tracker.
In case anyone was following along, pytorch and torchvision are now at their latest versions on Homebrew. As a bonus, Homebrew torchvision comes with torchvision's C++ front-end.
Thanks for the great work you've put into this project.
@carlocab thanks for the heads up!
cc @datumbox as a FYI because we are making breaking changes for the C++ frontend of torchvision
Most helpful comment
Ok, things finally finished compiling. I'm unable to reproduce the error locally. Apologies for cluttering your issue tracker.