采纳答案成功!
向帮助你的同学说点啥吧!感谢那些助人为乐的人
python -m sanic_http .\data\model\horse2zebra_0.4.0.pth 启动后
执行 curl -T .\data\2\horse1.jpg http://localhost:8000/image --output ./data/2/ret.jpg --max-time 600 -H “Content-Type: image/jpeg”
等10分钟也没反应 最后都是超时 图片开始几秒很快 后面的时间上传输的传输速度是0 然后 就是最后就是没反应了
看一下curl中的引号是否是中文引号?
如果还有这个问题再加print看看是否完成模型加载?
print("开始加载模型")
model = load_model("horse2zebra_0.4.0.pth")
print("模型加载完成")
开始加载模型 模型加载完成 Main 20:08:18 DEBUG: Creating multiprocessing context using 'spawn' Main 20:08:18 DEBUG: Starting a process: Sanic-Server-0-0 开始加载模型 模型加载完成 Srv 0 20:08:22 DEBUG: Process ack: Sanic-Server-0-0 [42716] Srv 0 20:08:22 INFO: Starting worker [42716] <Header('host': 'localhost:8000', 'user-agent': 'curl/8.9.1', 'accept': '*/*', 'content-length': '53549')> data part size: 53549 total size: 53549 data: 53549 input_tensor: torch.Size([1, 3, 228, 228]) 控制台日志 data: 图片大小 其实已经上传完了 但是 客服端显示如下 PS D:\1.work\PyTorchMedicalImaging> curl.exe -T .\data\2\horse1.jpg http://localhost:8000/image --output ./data/2/ret.jpg --max-time 600 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 53549 0 0 100 53549 0 512 0:01:44 0:01:44 --:--:-- 0
回复 读书林:一直卡着 直到超时
Srv 0 20:08:22 INFO: Starting worker [42716] <Header('host': 'localhost:8000', 'user-agent': 'curl/8.9.1', 'accept': '*/*', 'content-length': '53549')> data part size: 53549 total size: 53549 data: 53549 input_tensor: torch.Size([1, 3, 228, 228]) Srv 0 20:10:56 DEBUG: Error Page: The client accepts */*, using 'text' from __mp_main__.image Srv 0 20:10:56 ACCESS: 127.0.0.1:14909 PUT http://localhost:8000/image 500 70 7403.2ms Srv 0 20:10:56 ACCESS: 127.0.0.1:14909 PUT http://localhost:8000/image 500 DISCONNECTED 日志
登录后可查看更多问答,登录/注册
Pytorch算法开发与实战
277 7
167 6
159 6
226 4
326 3
购课补贴联系客服咨询优惠详情
慕课网APP您的移动学习伙伴
扫描二维码关注慕课网微信公众号