Get the error: AttributeError: Can't pickle local object 'convert_frame.<locals>._convert_frame'
See original GitHub issue🐛 Describe the bug
When adding the line:
model = torch.compile(model)
after loading the model, this error occurs. When removing the line, the script functions as intended.
Error logs
File “/opt/anaconda3/envs/ml1/lib/python3.8/multiprocessing/process.py”, line 121, in start self._popen = self._Popen(self) File “/opt/anaconda3/envs/ml1/lib/python3.8/multiprocessing/context.py”, line 224, in _Popen return _default_context.get_context().Process._Popen(process_obj) File “/opt/anaconda3/envs/ml1/lib/python3.8/multiprocessing/context.py”, line 284, in _Popen return Popen(process_obj) File “/opt/anaconda3/envs/ml1/lib/python3.8/multiprocessing/popen_spawn_posix.py”, line 32, in init super().init(process_obj) File “/opt/anaconda3/envs/ml1/lib/python3.8/multiprocessing/popen_fork.py”, line 19, in init self._launch(process_obj) File “/opt/anaconda3/envs/ml1/lib/python3.8/multiprocessing/popen_spawn_posix.py”, line 47, in _launch reduction.dump(process_obj, fp) File “/opt/anaconda3/envs/ml1/lib/python3.8/multiprocessing/reduction.py”, line 60, in dump ForkingPickler(file, protocol).dump(obj) AttributeError: Can’t pickle local object ‘convert_frame.<locals>._convert_frame’
Minified repro
No response
Issue Analytics
- State:
- Created 9 months ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
it sounds like @fladventurerob is trying to compile the model after loading it, not before exporting it.
however, @fladventurerob it would be helpful if you can provide a runnable script for us to look at, rather than just a description.
@fladventurerob any update on whether compile_threads=1 helps, or are you able to provide a repro script for us?