刘博士您好!我想要跑一下您的代码,在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.')
刘博士您好!我想要跑一下您的代码,在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=''之后依然报错。 因为我也只是个初学者,对代码不是很熟悉,所以想请教您问题出在哪里呢?