deepcoder icon indicating copy to clipboard operation
deepcoder copied to clipboard

_pickle.PicklingError: Can't pickle <function <lambda> at 0x7fb178651c10>: attribute lookup <lambda> on deepcoder.dsl.impl failed

Open dbl001 opened this issue 4 years ago • 1 comments

I got this error running: ./deepcoder/scripts/gen-datasets.sh

 File "/Users/davidlaxer/anaconda3/lib/python3.8/multiprocessing/reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
_pickle.PicklingError: Can't pickle <function <lambda> at 0x7fb178651c10>: attribute lookup <lambda> on deepcoder.dsl.impl failed

I am on OS X Monterey 12.1 Beta, in a tensorflow-metal virtual environment.

% python --version Python 3.8.5

% ./deepcoder/scripts/gen-datasets.sh
+ set -e
+ PROG_LENS=(1 2 3 4 5)
+ NB_TRAINS=(1000000 1000000 5000000 5000000 0)
+ NB_TESTS=(100 100 500 100 100)
+ NB_INPUTS=3
+ for idx in '${!PROG_LENS[*]}'
+ PROG_LEN=1
+ NB_TRAIN=1000000
+ NB_TEST=100
+ echo 'Generating programs T=1 #train=1000000 #test=100'
Generating programs T=1 #train=1000000 #test=100
+ OUT_PREFIX=T=1
+ TRAIN_PROG=T=1_train_programs.txt
+ TEST_PROG=T=1_test_programs.txt
+ TRAIN_OUT=T=1_train.json
+ TEST_OUT=T=1_test.json
+ python -m deepcoder.scripts.gen-programs --nb_inputs 3 --nb_train 1000000 --nb_test 100 --prog_len 1 --train_out T=1_train_programs.txt --test_out T=1_test_programs.txt --enforce_disjoint
Traceback (most recent call last):
  File "/Users/davidlaxer/anaconda3/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Users/davidlaxer/anaconda3/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/davidlaxer/deepcoder/deepcoder/scripts/gen-programs.py", line 97, in <module>
    main()
  File "/Users/davidlaxer/deepcoder/deepcoder/scripts/gen-programs.py", line 48, in main
    programs = enumerate_programs(input_type_combinations, args.prog_len,
  File "/Users/davidlaxer/deepcoder/deepcoder/search.py", line 195, in enumerate_programs
    worker.start()
  File "/Users/davidlaxer/anaconda3/lib/python3.8/multiprocessing/process.py", line 121, in start
    self._popen = self._Popen(self)
  File "/Users/davidlaxer/anaconda3/lib/python3.8/multiprocessing/context.py", line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "/Users/davidlaxer/anaconda3/lib/python3.8/multiprocessing/context.py", line 284, in _Popen
    return Popen(process_obj)
  File "/Users/davidlaxer/anaconda3/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)
  File "/Users/davidlaxer/anaconda3/lib/python3.8/multiprocessing/popen_fork.py", line 19, in __init__
    self._launch(process_obj)
  File "/Users/davidlaxer/anaconda3/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 47, in _launch
    reduction.dump(process_obj, fp)
  File "/Users/davidlaxer/anaconda3/lib/python3.8/multiprocessing/reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
_pickle.PicklingError: Can't pickle <function <lambda> at 0x7fb178651c10>: attribute lookup <lambda> on deepcoder.dsl.impl failed

dbl001 avatar Dec 05 '21 18:12 dbl001

Definitely do not have the solution to this problem. Having said that, I think I might have something of yours (david laxer) so... this is a weird way to find you but not sure of your correct email/phone address so I'm trying this comment. Probably will get deleted since it is non-responsive to the question but.... I really do think I know where something of yours is.... and would like to be helpful.... if this is annoying just drop me a line and tell me to go away.... marc DOT epstein AT gmail DOT com

mepst avatar Dec 08 '21 17:12 mepst