zhutmost / lsq-net

Unofficial implementation of LSQ-Net, a neural network quantization framework
MIT License
276 stars 40 forks source link

TypeError: argument of type 'PosixPath' is not iterable #3

Closed JachinMa closed 4 years ago

JachinMa commented 4 years ago

I tried to run 'python main.py config.yaml',but faced this problem:

Traceback (most recent call last): File "main.py", line 103, in main() File "main.py", line 18, in main log_dir = util.init_logger(args.name, output_dir, 'logging.conf') File "/home/j/Downloads/lsq-net-master/util/config.py", line 46, in init_logger logging.config.fileConfig(cfg_file, defaults={'logfilename': log_file}) File "/home/j/anaconda3/envs/py14/lib/python3.6/logging/config.py", line 84, in fileConfig handlers = _install_handlers(cp, formatters) File "/home/j/anaconda3/envs/py14/lib/python3.6/logging/config.py", line 146, in _install_handlers args = section["args"] File "/home/j/anaconda3/envs/py14/lib/python3.6/configparser.py", line 1234, in getitem return self._parser.get(self._name, key) File "/home/j/anaconda3/envs/py14/lib/python3.6/configparser.py", line 800, in get d) File "/home/j/anaconda3/envs/py14/lib/python3.6/configparser.py", line 394, in before_get self._interpolate_some(parser, option, L, value, section, defaults, 1) File "/home/j/anaconda3/envs/py14/lib/python3.6/configparser.py", line 435, in _interpolate_some if "%" in v: TypeError: argument of type 'PosixPath' is not iterable

I tried py1.4 and py1.5,they all dont work.

can you tell me how to deal with it?

zhutmost commented 4 years ago

It seems to be a Python-scope problem.

I don't know what py1.4 & 1.5 refer to. I work on the latest version of Anaconda3. And I think maybe you should use Python3+.

zhutmost commented 4 years ago

If you have solved your problem, pls let me know.

zhutmost commented 4 years ago

I have tried my code on python 3.6, and the same error occurs. Please update your python to 3.8, and have a try again. And the pytorch version must be 1.4. It is incompatible with the latest version i.e. v1.5. I will bump to the new version soon :D

dailingjun commented 1 year ago

Do not use python3.6 or replace the Line46 in util/config.py with "logging.config.fileConfig(cfg_file, defaults={'logfilename': log_file.str()})".