-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
能使用tfserving部署吗? #1
Comments
可以的,train.py文件模型导出改成pb格式就行 |
Lines 72 to 74 in 3e6645c
我后面加了个yolov5.save(log_dir + '/yolov5-tf', save_format='tf'),想保存成savedmodel部署到tf seving上,但是报错哎
|
在这里保存是不是batch size就被固定住了 |
@whalefa1I 你用的tf是哪个版本? |
2.7.0,换成2.3.0好像好一点 |
已经添加了相关pb模型保存代码,测试ok,可以拉一下再试试 @whalefa1I |
顺带修复了layers.py里面保存pb时的一些小问题. |
好的我试一下~! |
Lines 100 to 111 in 269385d
能在这个位置中间保存一下,然后后面做inference吗
我保存下来的savedmodel在inference的时候效果和tensorboard里面看到的不一样,效果比较差 |
嗯我知道,如果这么inference的话必须传batch_size张图片,所以想换个形式保存看看 |
你可以试试把batch-size设置为1,如果你多张图片就写个循环? |
哈哈哈哈好的,input_data = np.tile(np.expand_dims(input_data, axis=0), (16, 1, 1, 1)),我先这么弄看看,还是有点报错,辛苦辛苦 |
我summary了一下为啥出来的结果都堆在一起了,类似这样
|
是的,推理模式的时候,在模型里面已经把3层预测tensor的每一层都规整到图片的大小尺度下,所以只需要做进一步的nms就行。 |
哦哦哦,那就是刚才inference的时候
|
事实上, |
对的,我也很奇怪,明明里面封装好了,为啥我调不到 |
|
Line 91 in 269385d
如果把这个-1变成写出来,,前面的batch_size变成-1, 是不是前面的batch_size就不用固定了,那部署起来模型调用的时候就可以动态调用了 |
可以尝试下 |
如题
The text was updated successfully, but these errors were encountered: