ไม่สามารถโหลดกา Pytorch optimised นางแบบใน android

0

คำถาม

นี่คือข้อผิดพลาดฉันกำลังอยู่ใน android ขณะเรียกข้อมูลจากที่นคุณครูแต่พอกลับมา

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.example.cataractdetectionapp/com.android.example.cataractdetectionapp.InferenceActivity}: 

com.facebook.jni.CppException: Could not run 'aten::empty_strided' with arguments from the 'CUDA' backend.
This could be because the operator doesn't exist for this backend, or was omitted during the selective/custom build process (if using custom build). 
If you are a Facebook employee using PyTorch on mobile, please visit https://fburl.com/ptmfixes for possible resolutions. 

'aten::empty_strided' is only available for these backends: 
[CPU, Vulkan, BackendSelect, Python, Named, Conjugate, Negative, ADInplaceOrView, AutogradOther, AutogradCPU, AutogradCUDA, 
AutogradXLA, AutogradLazy, AutogradXPU, AutogradMLC, UNKNOWN_TENSOR_TYPE_ID, Autocast, Batched, VmapMode].

CPU: registered at aten/src/ATen/RegisterCPU.cpp:18433 [kernel]

Vulkan: registered at ../aten/src/ATen/native/vulkan/ops/Factory.cpp:47 [kernel]
BackendSelect: registered at aten/src/ATen/RegisterBackendSelect.cpp:665 [kernel]
Python: registered at ../aten/src/ATen/core/PythonFallbackKernel.cpp:47 [backend fallback]
Named: registered at ../aten/src/ATen/core/NamedRegistrations.cpp:7 [backend fallback]
Conjugate: fallthrough registered at ../aten/src/ATen/ConjugateFallback.cpp:22 [kernel]
Negative: fallthrough registered at ../aten/src/ATen/native/NegateFallback.cpp:22 [kernel]
ADInplaceOrView: fallthrough registered at ../aten/src/ATen/core/VariableFallbackKernel.cpp:64 [backend fallback]
AutogradOther: fallthrough registered at ../aten/src/ATen/core/VariableFallbackKernel.cpp:35 [backend fallback]
AutogradCPU: fallthrough registered at ../aten/src/ATen/core/VariableFallbackKernel.cpp:39 [backend fallback]
AutogradCUDA: fallthrough registered at ../aten/src/ATen/core/VariableFallbackKernel.cpp:47 [backend fallback]
AutogradXLA: fallthrough registered at ../aten/src/ATen/core/VariableFallbackKernel.cpp:51 [backend fallback]
AutogradLazy: fallthrough registered at ../aten/src/ATen/core/VariableFallbackKernel.cpp:55 [backend fallback]
AutogradXPU: fallthrough registered at ../aten/src/ATen/core/VariableFallbackKernel.cpp:43 [backend fallback]
AutogradMLC: fallthrough registered at ../aten/src/ATen/core/VariableFallbackKernel.cpp:59 [backend fallback]
UNKNOWN_TENSOR_TYPE_ID: fallthrough registered at ../aten/src/ATen/autocast_mode.cpp:466 [backend fallback]
Autocast: fallthrough registered at ../aten/src/ATen/autocast_mode.cpp:305 [backend fallback]
Batched: registered at ../aten/src/ATen/BatchingRegistrations.cpp:1016 [backend fallback]
VmapMode: fallthrough registered at ../aten/src/ATen/VmapModeRegistrations.cpp:33 [backend fallback]

ฉันใช้ด้านล่างรหัสสำหรับการโหลดมอดูล:

Module module = LiteModuleLoader.load(assetFilePath(getApplicationContext(), "Model.ptl"));

ที่ dependencies ฉันกำลังใช้สำหรับ Pytorch พตาม:

implementation 'org.pytorch:pytorch_android_lite:1.10.0'
implementation 'org.pytorch:pytorch_android_torchvision:1.10.0'
android pytorch
2021-11-23 13:02:07
1

คำตอบที่ดีที่สุด

0

ทางนี้เกิดข้อผิดพลาดมันก็ง่ายๆ ข้อผิดพลาดคือเพราะรุ่นช่วยด้ว Runtime เป็น ตัวประมวลผลกราฟิก. ดังนั้นฉันโหลดที่เป็นชนพื้นเมืองที่ PyTorch รุ่นอีกครั้งในหน่วยประมวลผลสภาพแวดล้อมและช่วยมันสำหรับย่อแค่ตัวแปลคำสั่งภาษาและมันเป็นเรียบร้อยแล้กำลังโหลดอยู่ใน android app

2021-12-09 13:51:50

ในภาษาอื่นๆ

หน้านี้อยู่ในภาษาอื่นๆ

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................