Closed harbecke closed 5 years ago
Deepcopy throws "TypeError: cannot deepcopy this pattern object"
Traceback:
File "/home/simon/PycharmProjects/hex/hex/training/train.py", line 249, in train puzzle_config = copy.deepcopy(config) File "/usr/lib/python3.6/copy.py", line 180, in deepcopy y = _reconstruct(x, memo, rv) File "/usr/lib/python3.6/copy.py", line 280, in _reconstruct state = deepcopy(state, memo) File "/usr/lib/python3.6/copy.py", line 150, in deepcopy y = copier(x, memo) File "/usr/lib/python3.6/copy.py", line 240, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "/usr/lib/python3.6/copy.py", line 180, in deepcopy y = _reconstruct(x, memo, rv) File "/usr/lib/python3.6/copy.py", line 280, in _reconstruct state = deepcopy(state, memo) File "/usr/lib/python3.6/copy.py", line 150, in deepcopy y = copier(x, memo) File "/usr/lib/python3.6/copy.py", line 240, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "/usr/lib/python3.6/copy.py", line 161, in deepcopy y = copier(memo) TypeError: cannot deepcopy this pattern object
try cf169f88405391d37b06a7ff7a4f56ec81b4ef00 ;)
seems to be done
"The creation of the not already existing puzzle data does not work for me. The problem seems to be that config cannot be deepcopied. When adding boardsize to config instead of puzzle_config everything seems to work. I do not know how to properly fix this."
Originally posted by @simonant in https://github.com/harbecke/hex/pull/22#issuecomment-516966344
I created an issue because the commit f49fe5ccdd42cf808c09bac37cdb388549e4f25e is outside the pull request. So you have to write
board_size
hard into the train.py script? What error does the deepcopy throw?