question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:open
  • Created 9 months ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
wconstabcommented, Dec 7, 2022

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.

0reactions
wconstabcommented, Dec 9, 2022

@fladventurerob any update on whether compile_threads=1 helps, or are you able to provide a repro script for us?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Example of CreateVideoFrame and ConvertFrame
I see the high-level documentation of CreateVideoFrame and ConvertFrame in the manual, but I can't find an example in the provided sample ...
Read more >
Create empty dataframe spark scala - f-static.net
Can't find the fulltext indicator can't find the original ... in conversion Input field to innable base class is not allowed to convert...
Read more >
“python file path /” Code Answer
ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type float). ... How to perform insertion sort, in Python? ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found