StevenLiuWen / ano_pred_cvpr2018

Official implementation of Paper Future Frame Prediction for Anomaly Detection -- A New Baseline, CVPR 2018
435 stars 126 forks source link

运行您的代码发现报错 #11

Closed ChengDuo0116 closed 6 years ago

ChengDuo0116 commented 6 years ago

刘博士您好!我想要跑一下您的代码,在python3.6的环境下按您的txt安装了相关库,然后出现了如下报错: /home/srp/anaconda3/envs/srp/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: compiletime version 3.5 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.6 return f(*args, **kwds) Traceback (most recent call last): File "/home/srp/anaconda3/envs/srp/lib/python3.6/configparser.py", line 1138, in _unify_values sectiondict = self._sections[section] KeyError: None

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "inference.py", line 10, in from constant import const File "/home/srp/chengduo/ano_pred_cvpr2018-master/Codes/constant.py", line 104, in const.L_NUM = config.getint(const.DATASET, 'L_NUM') File "/home/srp/anaconda3/envs/srp/lib/python3.6/configparser.py", line 819, in getint fallback=fallback, kwargs) File "/home/srp/anaconda3/envs/srp/lib/python3.6/configparser.py", line 809, in _get_conv kwargs) File "/home/srp/anaconda3/envs/srp/lib/python3.6/configparser.py", line 803, in _get return conv(self.get(section, option, **kwargs)) File "/home/srp/anaconda3/envs/srp/lib/python3.6/configparser.py", line 781, in get d = self._unify_values(section, vars) File "/home/srp/anaconda3/envs/srp/lib/python3.6/configparser.py", line 1141, in _unify_values raise NoSectionError(section) configparser.NoSectionError: No section: None

其中第一段报错像是库和python3.6不兼容,所以我又在python3.5的环境下运行,报错如下: Traceback (most recent call last): File "/home/srp/anaconda3/envs/srpp/lib/python3.5/configparser.py", line 1135, in _unify_values sectiondict = self._sections[section] KeyError: None

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "inference.py", line 10, in from constant import const File "/home/srp/chengduo/ano_pred_cvpr2018-master/Codes/constant.py", line 104, in const.L_NUM = config.getint(const.DATASET, 'L_NUM') File "/home/srp/anaconda3/envs/srpp/lib/python3.5/configparser.py", line 816, in getint fallback=fallback, kwargs) File "/home/srp/anaconda3/envs/srpp/lib/python3.5/configparser.py", line 806, in _get_conv kwargs) File "/home/srp/anaconda3/envs/srpp/lib/python3.5/configparser.py", line 800, in _get return conv(self.get(section, option, **kwargs)) File "/home/srp/anaconda3/envs/srpp/lib/python3.5/configparser.py", line 778, in get d = self._unify_values(section, vars) File "/home/srp/anaconda3/envs/srpp/lib/python3.5/configparser.py", line 1138, in _unify_values raise NoSectionError(section) configparser.NoSectionError: No section: None

看起来版本问题像是解决了,但第二段的bug依然存在。 这时候我注意到constant.py文件中的第30、31行: parser.add_argument('-d', '--dataset', type=str, help='the name of dataset.')

再对比上下文,发现漏掉了default参数,但我加上default=''之后依然报错。 因为我也只是个初学者,对代码不是很熟悉,所以想请教您问题出在哪里呢?

StevenLiuWen commented 6 years ago

@ChengDuo0116 py3.6是没问题的,那个只是warning,从记录上来看,应该是运行的时候,flag参数没有按照要求启动。 我的邮箱是liuwen@shanghaitech.edu.cn 运行问题,可以email给我,我帮你看看,可以吗?这个issue我先关了?

poweryin commented 5 years ago

你好,我跟你遇到了同样的问题,请问你最后解决了吗,是怎么解决的