bilylee / SiamFC-TensorFlow

A TensorFlow implementation of the SiamFC tracker
MIT License
366 stars 112 forks source link

在运行python experiments/SiamFC-3s-color-pretrained.py 出错 #15

Closed ghost closed 6 years ago

ghost commented 6 years ago

出错提示如下: Traceback (most recent call last): File "/home/cc/桌面/SiamFC-TensorFlow-master/experiments/SiamFC-3s-color-pretrained.py", line 32, in '--enforce_clean': False, File "/home/cc/anaconda3/lib/python3.6/site-packages/sacred/experiment.py", line 199, in run run() File "/home/cc/anaconda3/lib/python3.6/site-packages/sacred/run.py", line 229, in call self.result = self.main_function(args) File "/home/cc/anaconda3/lib/python3.6/site-packages/sacred/config/captured_function.py", line 48, in captured_function result = wrapped(args, kwargs) File "/home/cc/桌面/SiamFC-TensorFlow-master/scripts/convert_pretrained_model.py", line 64, in main model.build() File "/home/cc/桌面/SiamFC-TensorFlow-master/siamese_model.py", line 209, in build self.setup_embedding_initializer() File "/home/cc/桌面/SiamFC-TensorFlow-master/siamese_model.py", line 193, in setup_embedding_initializer 'convolutional_alexnet/', 'detection/') File "/home/cc/桌面/SiamFC-TensorFlow-master/utils/train_utils.py", line 163, in load_mat_model params = get_params_from_mat(matpath) File "/home/cc/桌面/SiamFC-TensorFlow-master/utils/train_utils.py", line 70, in get_params_from_mat netparams = sio.loadmat(matpath)["net"]["params"][0][0] File "/home/cc/anaconda3/lib/python3.6/site-packages/scipy/io/matlab/mio.py", line 141, in loadmat MR, file_opened = mat_reader_factory(file_name, appendmat, kwargs) File "/home/cc/anaconda3/lib/python3.6/site-packages/scipy/io/matlab/mio.py", line 64, in mat_reader_factory byte_stream, file_opened = _open_file(file_name, appendmat) TypeError: 'NoneType' object is not iterable

很明显是sio.loadmat()在执行时,产生某种意外错误。或许是跟 '--enforce_clean': False,这个参数有关。但当我新建一个脚本单独运行: import scipy.io as sio matpath="assets/2016-08-17.net.mat" netparams = sio.loadmat(matpath)["net"]["params"][0][0] print(type(netparams)) 结果正常,并未报错。 所以想问下您这是什么情况?感觉非常奇怪?

ghost commented 6 years ago

因为不在同一路径所以出错,刚刚已解决

bhr001 commented 5 years ago

@DLstudent,这个不同路径是什么和什么不同路径?我也遇到这个问腿了,搞不定

bhr001 commented 5 years ago

因为不在同一路径所以出错,刚刚已解决

兄弟,什么和什么路径不同啊?我也遇到这个问题了,搞不定啊

TachibanaYoshino commented 5 years ago

因为不在同一路径所以出错,刚刚已解决

兄弟,什么和什么路径不同啊?我也遇到这个问题了,搞不定啊

抱歉,我回复晚了,晚了十来天!我不知道你解决这个问题了没有啊,我呢当时是在终端运行的python experiments/SiamFC-3s-color-pretrained.py 。这时你要注意当前运行的文件主路径时./。所以你的预训练模型最好要按这个 matpath="./assets/2016-08-17.net.mat"路径给出,最好用绝对路径。而当你在pycharm中运行SiamFC-3s-color-pretrained.py 时,这时当前运行主路径就是./experiments/。所以你的预训练模型的文件路径要是上一层目录中的"assets/2016-08-17.net.mat",即在前面加../ matpath="../assets/2016-08-17.net.mat"。 懂了吗?我很早就对这个跟踪做了运行,改进等尝试,当然现在已经换了方向了。孪生-fc这个不好改进,没有太大的提升。现在你多关注一下孪生RPN,孪生rpn++。商汤的算法