Skip to content

Commit 90c771b

Browse files
Copilotkirklandsign
andcommitted
Improve error message for module not loaded
Co-authored-by: kirklandsign <107070759+kirklandsign@users.noreply.github.com>
1 parent 20bba0e commit 90c771b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • dl3/android/DeepLabV3Demo/app/src/main/java/org/pytorch/executorchexamples/dl3

dl3/android/DeepLabV3Demo/app/src/main/java/org/pytorch/executorchexamples/dl3/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ class MainActivity : ComponentActivity() {
362362
)
363363

364364
// Ensure module is loaded before running inference
365-
val loadedModule = module ?: throw IllegalStateException("Module not loaded")
365+
val loadedModule = module ?: throw IllegalStateException("Module not loaded. Please download the model first.")
366366

367367
val startTime = SystemClock.elapsedRealtime()
368368
val outputTensor = loadedModule.forward(EValue.from(inputTensor))[0].toTensor()

0 commit comments

Comments
 (0)