Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase. #12

Open
lwyncepu opened this issue Jun 27, 2021 · 4 comments

Comments

@lwyncepu
Copy link

python main-makespan.py

2021-06-27 22:57:21.987365: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
Jobs number: 10
Tasks number: 93
Task instances number mean: 45.376344086021504
Task instances number std 85.48783652126134
Task instances cpu mean: 0.5264810426540284
Task instances cpu std: 0.10018140357202873
Task instances memory mean: 0.009175121384696406
Task instances memory std: 0.002757219144923028
Task instances duration mean: 74.68815165876777
Task instances duration std: 45.40343044250821
680 0.4279005527496338 62.05685685072286 1.4292964198242561
********** Iteration 0 ************
2021-06-27 22:57:31.490100: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
Jobs number: 10
Tasks number: 93
Task instances number mean: 45.376344086021504
Task instances number std 85.48783652126134
Task instances cpu mean: 0.5264810426540284
Task instances cpu std: 0.10018140357202873
Task instances memory mean: 0.009175121384696406
Task instances memory std: 0.002757219144923028
Task instances duration mean: 74.68815165876777
Task instances duration std: 45.40343044250821
680 0.4458014965057373 62.05685685072286 1.4292964198242561
********** Iteration 0 ************
Traceback (most recent call last):
File "", line 1, in
File "D:\anaconda3\envs\deepjs\lib\multiprocessing\spawn.py", line 105, in spawn_main
exitcode = _main(fd)
File "D:\anaconda3\envs\deepjs\lib\multiprocessing\spawn.py", line 114, in _main
prepare(preparation_data)
File "D:\anaconda3\envs\deepjs\lib\multiprocessing\spawn.py", line 225, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "D:\anaconda3\envs\deepjs\lib\multiprocessing\spawn.py", line 277, in _fixup_main_from_path
run_name="mp_main")
File "D:\anaconda3\envs\deepjs\lib\runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "D:\anaconda3\envs\deepjs\lib\runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "D:\anaconda3\envs\deepjs\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:\2021\Bin-packing\deepjs\CloudSimPy-master\playground\Non_DAG\launch_scripts\main-makespan2.py", line 78, in
manager = Manager()
File "D:\anaconda3\envs\deepjs\lib\multiprocessing\context.py", line 56, in Manager
m.start()
File "D:\anaconda3\envs\deepjs\lib\multiprocessing\managers.py", line 513, in start
self._process.start()
File "D:\anaconda3\envs\deepjs\lib\multiprocessing\process.py", line 105, in start
self._popen = self._Popen(self)
File "D:\anaconda3\envs\deepjs\lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)
File "D:\anaconda3\envs\deepjs\lib\multiprocessing\popen_spawn_win32.py", line 33, in init
prep_data = spawn.get_preparation_data(process_obj._name)
File "D:\anaconda3\envs\deepjs\lib\multiprocessing\spawn.py", line 143, in get_preparation_data
_check_not_importing_main()
File "D:\anaconda3\envs\deepjs\lib\multiprocessing\spawn.py", line 136, in _check_not_importing_main
is not going to be frozen to produce an executable.''')
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.

    This probably means that you are not using fork to start your
    child processes and you have forgotten to use the proper idiom
    in the main module:

        if __name__ == '__main__':
            freeze_support()
            ...

    The "freeze_support()" line can be omitted if the program
    is not going to be frozen to produce an executable.

I‘m running this code on Windows,can anybody help me with this?
Thanks in advance!

@cjd2549287766
Copy link

Do you solve this problem?

@vamsikunal
Copy link

Try to run in Linux.

@vamsikunal
Copy link

Make sure all requirements libraries are the correct version.

@AnasHattay
Copy link

Hello!

Just try adding freeze_support() like this:

if __name__ == '__main__':
    freeze_support()  
    tic = time.time()
    algorithm = RandomAlgorithm()
    episode = Episode(machine_configs, jobs_configs, algorithm, None)
    episode.run()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants