当前位置:网站首页>TorchServe避坑指南
TorchServe避坑指南
2022-06-25 06:33:00 【Rory602】
1、报错日志1
java.lang.NoSuchMethodError: java.nio.file.Files.readString(Ljava/nio/file/Path;)Ljava/lang/String;
at org.pytorch.serve.util.ConfigManager.readFile(ConfigManager.java:235)
at org.pytorch.serve.util.ConfigManager.<init>(ConfigManager.java:139)
at org.pytorch.serve.util.ConfigManager.init(ConfigManager.java:285)
at org.pytorch.serve.ModelServer.main(ModelServer.java:83)
解决方案
jdk的版本不对,安装jdk 11
2、报错日志2
2022-06-24T16:46:07,995 [DEBUG] W-9000-mnist_1.0 org.pytorch.serve.wlm.WorkerThread - Backend worker monitoring thread interrupted or backend worker process died.
java.lang.InterruptedException: null
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2056) ~[?:?]
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2133) ~[?:?]
at java.util.concurrent.ArrayBlockingQueue.poll(ArrayBlockingQueue.java:432) ~[?:?]
at org.pytorch.serve.wlm.WorkerThread.run(WorkerThread.java:189) [model-server.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:834) [?:?]
解决方案
查看启动日志目录
log
-rw-rw-r-- 1 user user 0 6月 24 16:41 access_log.log
drwxrwxr-x 2 user user 4096 6月 24 17:17 config/
-rw-rw-r-- 1 user user 68837 6月 24 17:17 model_log.log
-rw-rw-r-- 1 user user 0 6月 24 16:41 model_metrics.log
-rw-rw-r-- 1 user user 184677 6月 24 17:17 ts_log.log
-rw-rw-r-- 1 user user 2492 6月 24 17:17 ts_metrics.log
(torch) [email protected]:~/code/python/serve/examples/image_classifier/mnist/logs$ more model_log.log
2022-06-24T16:41:37,286 [INFO ] W-9000-mnist_1.0-stdout MODEL_LOG - Listening on port: /tmp/.ts.sock.9000
2022-06-24T16:41:37,289 [INFO ] W-9000-mnist_1.0-stdout MODEL_LOG - [PID]2052890
2022-06-24T16:41:37,289 [INFO ] W-9000-mnist_1.0-stdout MODEL_LOG - Torch worker started.
2022-06-24T16:41:37,290 [INFO ] W-9000-mnist_1.0-stdout MODEL_LOG - Python runtime: 3.8.12
2022-06-24T16:41:37,349 [INFO ] W-9000-mnist_1.0-stdout MODEL_LOG - Connection accepted: /tmp/.ts.sock.9000.
2022-06-24T16:41:37,392 [INFO ] W-9000-mnist_1.0-stdout MODEL_LOG - model_name: mnist, batchSize: 1
2022-06-24T16:41:38,418 [INFO ] W-9000-mnist_1.0-stdout MODEL_LOG - Backend worker process died.
2022-06-24T16:41:38,418 [INFO ] W-9000-mnist_1.0-stdout MODEL_LOG - Traceback (most recent call last):
2022-06-24T16:41:38,419 [INFO ] W-9000-mnist_1.0-stdout MODEL_LOG - File "/home/user/.conda/envs/torch/lib/python3.8/site-packages/ts/model_loader.py", line 100, in load
2022-06-24T16:41:38,420 [INFO ] W-9000-mnist_1.0-stdout MODEL_LOG - module, function_name = self._load_handler_file(handler)
2022-06-24T16:41:38,420 [INFO ] W-9000-mnist_1.0-stdout MODEL_LOG - File "/home/user/.conda/envs/torch/lib/python3.8/site-packages/ts/model_loader.py", line 162, in _load_handler_file
2022-06-24T16:41:38,421 [INFO ] W-9000-mnist_1.0-stdout MODEL_LOG - module = importlib.import_module(module_name)
2022-06-24T16:41:38,422 [INFO ] W-9000-mnist_1.0-stdout MODEL_LOG - File "/home/user/.conda/envs/torch/lib/python3.8/importlib/__init__.py", line 127, in import_module
2022-06-24T16:41:38,423 [INFO ] W-9000-mnist_1.0-stdout MODEL_LOG - return _bootstrap._gcd_import(name[level:], package, level)
2022-06-24T16:41:38,423 [INFO ] W-9000-mnist_1.0-stdout MODEL_LOG - File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
2022-06-24T16:41:38,424 [INFO ] W-9000-mnist_1.0-stdout MODEL_LOG - File "<frozen importlib._bootstrap>", line 991, in _find_and_load
2022-06-24T16:41:38,424 [INFO ] W-9000-mnist_1.0-stdout MODEL_LOG - File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
2022-06-24T16:41:38,425 [INFO ] W-9000-mnist_1.0-stdout MODEL_LOG - File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
2022-06-24T16:41:38,427 [INFO ] W-9000-mnist_1.0-stdout MODEL_LOG - File "<frozen importlib._bootstrap_external>", line 843, in exec_module
2022-06-24T16:41:38,428 [INFO ] W-9000-mnist_1.0-stdout MODEL_LOG - File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
2022-06-24T16:41:38,428 [INFO ] W-9000-mnist_1.0-stdout MODEL_LOG - File "/tmp/models/4c322bc17dbd478985c9c9888ab9b836/mnist_handler.py", line 2, in <module>
2022-06-24T16:41:38,429 [INFO ] W-9000-mnist_1.0-stdout MODEL_LOG - from ts.torch_handler.image_classifier import ImageClassifier
2022-06-24T16:41:38,429 [INFO ] W-9000-mnist_1.0-stdout MODEL_LOG - File "/home/user/.conda/envs/torch/lib/python3.8/site-packages/ts/torch_handler/image_classifier.py", line 8, in <module>
2022-06-24T16:41:38,430 [INFO ] W-9000-mnist_1.0-stdout MODEL_LOG - from .vision_handler import VisionHandler
2022-06-24T16:41:38,430 [INFO ] W-9000-mnist_1.0-stdout MODEL_LOG - File "/home/user/.conda/envs/torch/lib/python3.8/site-packages/ts/torch_handler/vision_handler.py", line 11, in <module>
2022-06-24T16:41:38,431 [INFO ] W-9000-mnist_1.0-stdout MODEL_LOG - from captum.attr import IntegratedGradients
2022-06-24T16:41:38,431 [INFO ] W-9000-mnist_1.0-stdout MODEL_LOG - ModuleNotFoundError: No module named 'captum'
2022-06-24T16:41:38,432 [INFO ] W-9000-mnist_1.0-stdout MODEL_LOG -
需要安装
captum包,pip install captum即可
边栏推荐
- 2022 biological fermentation Exhibition (Jinan), which is a must read before the exhibition. The most comprehensive exhibition strategy will take you around the "fermentation circle"
- How to create a handy vs Code?
- fastadmin 联级清空数据
- アルマ / 炼金妹
- @Detailed explanation of valid annotation usage
- Metauniverse in 2022: robbing people, burning money and breaking through the experience boundary
- Self adjustment process of MySQL index tree when adding data
- How to record a database [closed] - how to document a database [closed]
- In a single-page app, what is the right way to deal with wrong URLs (404 errors)?
- Bcrypt password encryption kalrry
猜你喜欢

Derivation of sin (a-b) =sina*cosb-sinb*cosa

What is VLAN

Cs4344/ht5010 stereo d/a digital to analog converter
![[轻松学会shell编程]-5、计划任务](/img/6f/8067d4201f0c2e7a692d89885e3ad9.png)
[轻松学会shell编程]-5、计划任务

2022 AI trend 8 forecast!
![Analysis on the scale of China's smart airport industry in 2020: there is still a large space for competition in the market [figure]](/img/cd/c8be09eca7b41407b0ca1f3b4f3fe8.jpg)
Analysis on the scale of China's smart airport industry in 2020: there is still a large space for competition in the market [figure]

Methods for obtaining some information of equipment

Monitoring access: how to grant minimum WMI access to the monitoring service account

百度地图——入门教程

Microsoft issued a document to celebrate Net 20th anniversary!
随机推荐
Arm register (cortex-a), coprocessor and pipeline
keil debug查看变量提示not in scope
Ht513 I2S input 2.8W mono class D audio power amplifier IC
Guess the size of the number
cos(a-b)=cosa*cosb+sina*sinb的推导过程
What is the slice flag bit
DNS domain name system
sin(a-b)=sina*cosb-sinb*cosa的推导过程
Can TCP syn handshake messages transmit data
Coffee script unmatched outent error
[从零开始学习FPGA编程-43]:视野篇 - 后摩尔时代”芯片设计的技术演进-2-演进方向
Ht8513 single lithium battery power supply with built-in Dynamic Synchronous Boost 5W mono audio power amplifier IC solution
Acwing2013. three lines
Analysis on the scale of China's smart airport industry in 2020: there is still a large space for competition in the market [figure]
Derivation of COS (a+b) =cosa*cosb-sina*sinb
Metauniverse in 2022: robbing people, burning money and breaking through the experience boundary
Detailed explanation of @jsoninclude annotation in Jackson
How do I check swift if two arrays contain the same elements, regardless of the order in which they appear?
Zero foundation wants to learn web security, how to get started?
有能力的人从不抱怨大环境!