Open Sunwb-star opened 9 months ago
你好,下面是对你的问题的一些思考:
1.可以在边缘测之间传入相同的输入,运行两次,观测一下是否单设备执行两个输出是相同的。以模型分割的原理来讲,云边端设备上参数都是相同的,不会出现这样的问题,检查一下有没有设置model.eval(),来暂停dropout()带来的随机性。
感谢您的回复,第一个问题确实如您所说,在我添加了model.eval()之后模型每次都能输出相同的结果,万分感谢,输出结果如下:
successfully connection :<socket.socket fd=1852, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 9999), raddr=('127.0.0.1', 53495)> get model type successfully. get partition point successfully. get edge_output and transfer latency successfully. short message , transfer latency has been sent successfully short message , cloud latency has been sent successfully 概率: tensor([[0.4158, 0.5842]], device='cuda:0') 预测类别: dog ================= DNN Collaborative Inference Finished. =================== successfully connection :<socket.socket fd=968, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 9999), raddr=('127.0.0.1', 53504)> get model type successfully. get partition point successfully. get edge_output and transfer latency successfully. short message , transfer latency has been sent successfully short message , cloud latency has been sent successfully 概率: tensor([[0.4158, 0.5842]], device='cuda:0') 预测类别: dog ================= DNN Collaborative Inference Finished. =================== successfully connection :<socket.socket fd=1840, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 9999), raddr=('127.0.0.1', 53517)> get model type successfully. get partition point successfully. get edge_output and transfer latency successfully. short message , transfer latency has been sent successfully short message , cloud latency has been sent successfully 概率: tensor([[0.4158, 0.5842]], device='cuda:0') 预测类别: dog ================= DNN Collaborative Inference Finished. ===================
至于第二个问题,我之后再进行一下测试,然后再跟您讨论一下。
再次感谢您的帮助,谢谢!
大佬你好,我在部署代码的过程中主要出现了两个问题。