运行flask uwsgi
来调用keras(使用tensorflow后端)对象检测API时遇到问题,错误为“ DAMN!报告工人1(pid:5240)死亡,被信号11 :(尝试重生……)杀死。然后,我尝试仅使用一个线程,但是它不起作用。相反,会发生另一个错误,即“ !!! uWSGI进程347出现分段错误!!!”。谁能给我些帮助吗?非常感谢
以下是我的配置文件:
[uwsgi]
module = img_recognize_demo_3:app
protocol = http
master = true
processess = 2
threads = 2
chdir = /media/xiu/新加卷/FlasklrProj
thunder-lock=true
http-socket = 0.0.0.0:5000
logto = /media/xiu/新加卷/FlasklrProj/img_demo.log
chmod-socket = 666
vacuum = true
这是我的日志文件中的错误:
*** Operational MODE: threaded ***
Using TensorFlow backend.
设置tensorflow后台:
2018-11-05 15:39:05.848219: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
2018-11-05 15:39:05.848850: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1524] Found device 0 with properties:
name: Ellesmere [Radeon Pro WX 7100]
AMDGPU ISA: gfx803
memoryClockRate (GHz) 1.243
pciBusID 0000:02:00.0
Total memory: 8.00GiB
Free memory: 7.75GiB
2018-11-05 15:39:05.848918: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1635] Adding visible gpu devices: 0
2018-11-05 15:39:05.848975: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1044] Device interconnect StreamExecutor with strength 1 edge matrix:
2018-11-05 15:39:05.849021: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1050] 0
2018-11-05 15:39:05.849068: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1063] 0: N
2018-11-05 15:39:05.849139: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1183] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 7539 MB memory) -> physical GPU (device: 0, name: Ellesmere [Radeon Pro WX 7100], pci bus id: 0000:02:00.0)
WSGI app 0 (mountpoint='') ready in 9 seconds on interpreter 0x559665933a40 pid: 10593 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 10593)
spawned uWSGI worker 1 (pid: 10662, cores: 2)
[pid: 10662|app: 0|req: 1/1] 127.0.0.1 () {32 vars in 817 bytes} [Mon Nov 5 15:39:14 2018] GET /demo/config?data_dir=/media/xiu/%E6%96%B0%E5%8A%A0%E5%8D%B7/upload/testImg&save_dir=/media/xiu/%E6%96%B0%E5%8A%A0%E5%8D%B7/upload/testout2&if_object=1 => generated 237 bytes in 2 msecs (HTTP/1.1 200) 2 headers in 72 bytes (1 switches on core 0)
开始调用物体检测函数
读取待检测图片, 执行模型预测 /media/xiu/新加卷/upload/testImg/69c732e4gy1fuw8eljyssj20u00u0gn3.jpg
DAMN ! worker 1 (pid: 10662) died, killed by signal 11 :( trying respawn ...
Respawned uWSGI worker 1 (new pid: 10739)
[deadlock-detector] a process holding a robust mutex died. recovering...