栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

复现Multi-Adapter RGBT Tracking

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

复现Multi-Adapter RGBT Tracking

这里简单谈一下复现这篇文章所遇到的几个问题:
①在我将run_tracker.py里的文件路径全部改完并运行之后,报了这个错误:

cannot import name ‘imresize’ from ‘scipy.misc’

然后我百度发现scipy版本问题。scipy>=1.0.0不再包含函数imresize,官网给出的解释及解决办法如下:

from scipy.misc import imresize
imresize()

改为:

from PIL import Image
numpy.array(Image.fromarray(arr).resize())

参考文献:官网
cannot import name ‘imresize’ from ‘scipy.misc’
而这里具体是改为:

from PIL import Image
......
# scaled = imresize(cropped, (img_size, img_size))
np.array(Image.fromarray(cropped).resize(img_size, img_size))

②文章中的print语法貌似是高版本不适用,所以也要改,以下我用一个例子来说明:

#如train.py中的:
print "Cycle %2d, K %2d (%2d), Loss %.3f, Prec %.3f, Time %.3f" % 
                    (i, j, k, loss.data[0], prec[k], toc)

改为:

print("Cycle" + i + ", K" + j( k) + "," + " Loss ," + loss.data[0] + "Prec" + prec[k] + ", Time" + toc)

例子:

# print "Save model to %s" % opts['model_path']

改为:

print("Save model to"+ opts['model_path'])

③在执行train.py中又遇到这个错误:

AttributeError: ‘dict’ object has no attribute ‘iteritems’

原因:python3中iteritems()被items()代替了

解决办法:将××.iteritems()改成××.items()
参考文献:AttributeError: ‘dict‘ object has no attribute ‘iteritems‘

④继续执行train.py遇到错误:

ValueError: Unknown resampling filter (107). Use Image.NEAREST (0), Image.LANCZOS (1), Image.BILINEAR (2), Image.BICUBIC (3), Image.BOX (4) or Image.HAMMING (5)

解决办法:

参考文献:
解决“ValueError: Unknown resampling filter (107). Use Image.NEAREST (0), Image.LANCZOS (1), Image.BIL”

⑤继续执行train.py遇到错误:

TypeError: int() argument must be a string, a bytes-like object or a number, not ‘NoneType’

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/1017773.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号