fatejzz
fatejzz
@zhiqwang @glenn-jocher when I convert the input image into the tensor according to the image shape and input it into the model, there will be some errors like the above....
I just quote the two codes, and it can work well until now. but the 'letterbox' has some differences in mechanisms from others. `padd_w=padd_w%64; padd_h=padd_h%64;`
@glenn-jocher After discussing it with others, I am wondering whether it is because when I use torchscript to export the model, the model's input size has been limited like [640,640].
就是那个官方的源码中他好像是会根据stride计算两边所需要填充的像素个数,比如输入[1920×1080]的图像,用你的源码会生成[640×640],按照官方的思路会生成[640×384],官方好像采取了一种最小pad(填充)的原理。 类似这样:“设置最多不能pad超过64像素,故对(640-360)采用取模操作,变成280%32=24,然后对15进行/2,然后左右pad即可” 但是我按照官方这样写,就是把图片转换成tensor后 > torch::Tensor` in_tensor = torch::from_blob(resized_frame.data, {int(resized_frame.rows),int(resized_frame.cols),3}, torch::kByte) 如果是用当前图片的形状却会报错,[640,640,3]不会报错但效果上来看会生成一些不准确的框(参照python源码的detect) 但是我看大多数人都是这样写的
@ncdhz 我理解的是采用最小pad是为了加快推理速度,然后因为我模型转成torchscript模型的输入尺寸就被限制了(这一点我稍后会去了解),所以只能输入经过未最小pad处理后的[640×640]图像这样吗。
那我应该是要使用torchscript转换模型的时候确定图片大小吧
@luisdavikp have you solved this problem, I meet this problem when I want to add the opencv-contrib module in the original opencv by compiling.
我有类似的训练时内存不断增加的问题,调试之后发现是eval阶段内存占用会不断增大
请问你找到缺少这个函数的解决方法了吗