You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.
While following the directions to compile and run the gradle demo app, I ran into strage macOS Catalina issue. This happens after executing the following command.
pop up dialog.
.gradle run command
Please see the attached screenshots of the OS
StackTrace of the Build Fail exception:
~/Code/Java/LibTorch-PyTorch/java-demo-master $ ./gradlew run
Task :run FAILED
Exception in thread "main" java.lang.UnsatisfiedLinkError: /Users/sj/Code/Java/LibTorch-PyTorch/libtorch/lib/libpytorch_jni.dylib: dlopen(/Users/sj/Code/Java/LibTorch-PyTorch/libtorch/lib/libpytorch_jni.dylib, 1): Library not loaded: @rpath/libtorch_cpu.dylib
Referenced from: /Users/sj/Code/Java/LibTorch-PyTorch/libtorch/lib/libpytorch_jni.dylib
Reason: no suitable image found. Did find:
/Users/sj/Code/Java/LibTorch-PyTorch/libtorch/lib/libtorch_cpu.dylib: code signature in (/Users/sj/Code/Java/LibTorch-PyTorch/libtorch/lib/libtorch_cpu.dylib) not valid for use in process using Library Validation: library load disallowed by system policy
at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2430)
at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2487)
at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2684)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2649)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:829)
at java.base/java.lang.System.loadLibrary(System.java:1870)
at com.facebook.soloader.nativeloader.SystemDelegate.loadLibrary(SystemDelegate.java:22)
at com.facebook.soloader.nativeloader.NativeLoader.loadLibrary(NativeLoader.java:43)
at org.pytorch.NativePeer.(NativePeer.java:11)
at org.pytorch.Module.load(Module.java:23)
at demo.App.main(App.java:12)
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':run'.
Process 'command '/Library/Java/JavaVirtualMachines/jdk-11.0.5.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
The text was updated successfully, but these errors were encountered:
Here is the fix that I found and submitting a documentation update PR for the same so it can help other macOS users.
Run the following commands after the warning popup occurs so as to delete the macOS quarantine flag from all the files inside of /path/to/libtorch/lib folder
xattr -r -d com.apple.quarantine /path/to/libtorch/lib
./gradlew run
While following the directions to compile and run the gradle demo app, I ran into strage macOS Catalina issue. This happens after executing the following command.
pop up dialog.
Please see the attached screenshots of the OS
![Screen Shot 2020-04-12 at 1 01 18 AM](https://user-images.githubusercontent.com/395039/79064084-b4c60a80-7c5a-11ea-9108-90b69ba8022d.png)
![Screen Shot 2020-04-12 at 1 00 31 AM](https://user-images.githubusercontent.com/395039/79064085-b55ea100-7c5a-11ea-8568-9d693b942212.png)
StackTrace of the Build Fail exception:
The text was updated successfully, but these errors were encountered: