ihmily / image-matting

a simple online image matting web based on cv_unet_image-matting and cv_unet_universal-matting model
MIT License
283 stars 25 forks source link

容器运行不到1分钟就出错停止 #4

Open DrewNeon opened 2 weeks ago

DrewNeon commented 2 weeks ago

我在群晖的Docker里尝试安装了好几次,容器总是运行不到1分钟就停止。日志里只有一行WARNING看着可疑,是不是缺少什么环境变量?

2024-07-02 12:30:13,945 - modelscope - WARNING - Model revision not specified, use revision: v1.0.0

ihmily commented 2 weeks ago

这个提示没有关系的,不是这个问题。机器运行内存多大的?

DrewNeon commented 2 weeks ago

这个提示没有关系的,不是这个问题。机器运行内存多大的?

4G

ihmily commented 2 weeks ago

WEB API服务有成功运行吗?是在抠图的时候停止的还是在启动的时候就没启动成功就报错了?

刚刚试了一下,正常运行信息如下:

2024-07-02 15:40:08,558 - modelscope - INFO - PyTorch version 2.1.2 Found.
2024-07-02 15:40:08,565 - modelscope - INFO - TensorFlow version 2.15.0 Found.
2024-07-02 15:40:08,565 - modelscope - INFO - Loading ast index from C:\Users\Administrator\.cache\modelscope\ast_indexer
2024-07-02 15:40:08,903 - modelscope - INFO - Loading done! Current index file version is 1.10.0, with md5 9340411f03eab58a8b184e4966d62a73 and a total number of 946 components indexed
2024-07-02 15:40:14,295 - modelscope - WARNING - Model revision not specified, use revision: v1.0.0
2024-07-02 15:40:15.380090: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
WARNING:tensorflow:From D:\anaconda\envs\image_matting\lib\site-packages\keras\src\losses.py:2976: The name tf.losses.sparse_softmax_cross_entropy is deprecated. Please use tf.compat.v1.losses.sparse_softmax_cross_entropy instead.

2024-07-02 15:40:33,635 - modelscope - INFO - initiate model from C:\Users\Administrator\.cache\modelscope\hub\damo\cv_unet_universal-matting
2024-07-02 15:40:33,636 - modelscope - INFO - initiate model from location C:\Users\Administrator\.cache\modelscope\hub\damo\cv_unet_universal-matting.
2024-07-02 15:40:33,653 - modelscope - WARNING - No preprocessor field found in cfg.
2024-07-02 15:40:33,653 - modelscope - WARNING - No val key and type key found in preprocessor domain of configuration.json file.
2024-07-02 15:40:33,653 - modelscope - WARNING - Cannot find available config to build preprocessor at mode inference, current config: {'model_dir': 'C:\\Users\\Administrator\\.cache\\modelscope\\hub\\damo\\cv_unet_universal-matting'}. trying to build by task and model information.
2024-07-02 15:40:33,653 - modelscope - WARNING - Find task: universal-matting, model type: None. Insufficient information to build preprocessor, skip building preprocessor
WARNING:tensorflow:From D:\anaconda\envs\image_matting\lib\site-packages\modelscope\utils\device.py:60: is_gpu_available (from tensorflow.python.framework.test_util) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.config.list_physical_devices('GPU')` instead.
2024-07-02 15:40:33.659849: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: SSE SSE2 SSE3 SSE4.1 SSE4.2 AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
WARNING:tensorflow:From D:\anaconda\envs\image_matting\lib\site-packages\modelscope\pipelines\cv\image_matting_pipeline.py:40: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.

2024-07-02 15:40:33,807 - modelscope - INFO - loading model from C:\Users\Administrator\.cache\modelscope\hub\damo\cv_unet_universal-matting\tf_graph.pb
WARNING:tensorflow:From D:\anaconda\envs\image_matting\lib\site-packages\modelscope\pipelines\cv\image_matting_pipeline.py:45: FastGFile.__init__ (from tensorflow.python.platform.gfile) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.gfile.GFile.
2024-07-02 15:40:36,419 - modelscope - INFO - load model done
INFO:     Started server process [29548]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)

image

DrewNeon commented 2 weeks ago

启动时就停止了,Web页打不开,没法抠图

ihmily commented 2 weeks ago

启动时就停止了,Web页打不开,没法抠图

可能内存太小了 加载模型失败,换个环境试试吧

DrewNeon commented 2 weeks ago

还真是,换了台NAS就跑起来了