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

进程创建后不能启动 #7

Closed
silkyrose opened this issue Feb 12, 2020 · 7 comments
Closed

进程创建后不能启动 #7

silkyrose opened this issue Feb 12, 2020 · 7 comments

Comments

@silkyrose
Copy link

主程序main-makespan.py在windows下执行
已增加:
if name == 'main':
freeze_support()
可以看到Process创建了13个进程,但是第一进程就不能start()
报错说它不能转换为数值

 for i in range(n_episode):
     algorithm = RLAlgorithm(agent, reward_giver, features_extract_func=features_extract_func,
                             features_normalize_func=features_normalize_func)
     episode = Episode(machine_configs, jobs_configs, algorithm, None)
     algorithm.reward_giver.attach(episode.simulation)
     p = Process(target=multiprocessing_run,
                 args=(episode, trajectories, makespans, average_completions, average_slowdowns))
     p.start()
     p.join()
 #

WARNING:tensorflow:From C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\training\checkpointable\util.py:1858: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
Traceback (most recent call last):
File "E:/DPL/CloudSimPy-master/CloudSimPy-master/playground/Non_DAG/launch_scripts/main-makespan.py", line 93, in
pj.start()
File "C:\ProgramData\Anaconda3\lib\multiprocessing\process.py", line 112, in start
self._popen = self._Popen(self)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\popen_spawn_win32.py", line 65, in init
reduction.dump(process_obj, to_child)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 745, in reduce
return (convert_to_tensor, (self.numpy(),))
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 724, in numpy
raise ValueError("Resource handles are not convertible to numpy.")
ValueError: Resource handles are not convertible to numpy.

@HaodaY
Copy link

HaodaY commented Feb 13, 2020

我也遇到了这个问题,请问你解决了吗?

@silkyrose
Copy link
Author

silkyrose commented Feb 27, 2020 via email

@HaodaY
Copy link

HaodaY commented Feb 27, 2020

我改成用单进程去运行了

@silkyrose
Copy link
Author

silkyrose commented Feb 28, 2020 via email

@silkyrose
Copy link
Author

作者看到了也不出来说几句。。。。。。

@Mikey2266
Copy link

    for i in range(n_episode):
        algorithm = RLAlgorithm(agent, reward_giver, features_extract_func=features_extract_func,
                                features_normalize_func=features_normalize_func)
        episode = Episode(machine_configs, jobs_configs, algorithm, None)
        algorithm.reward_giver.attach(episode.simulation)

        multiprocessing_run(episode, trajectories, makespans, average_completions, average_slowdowns)
    #     p = Process(target=multiprocessing_run,
    #                 args=(episode, trajectories, makespans, average_completions, average_slowdowns))
    # 
    #     processes.append(p)
    # 
    # for p in processes:
    #     p.start()
    # 
    # for p in processes:
    #     p.join()

@taichanghong
Copy link

我改成用单进程去运行了

请问是怎样操作的?

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