EscapeTheWind / Edge-Computing-and-Caching-Optimization-based-on-PPO-for-Task-Offloading-in-RSU-assisted-IoV

47 stars 8 forks source link

some error when tring to run the project #7

Closed lzd-1230 closed 2 months ago

lzd-1230 commented 3 months ago

Hi , I'm new to this project, when I entering run_this folder and try to run the project, I got this error

python run_object.py
Start training!
Env: Road State, Algo: PPO Discrete, Device: cuda
n states: 191, n actions: 313
------use_orthogonal_init------
------use_orthogonal_init------
Traceback (most recent call last):
  File "D:\file_sum\python\Edge-Computing-and-Caching-Optimization-based-on-PPO-for-Task-Offloading-in-RSU-assisted-IoV\run_this\run_object.py", line 7, in <module>
    reward, ma_hit_rate, time, ma_all_hit_rate, args = run_ppo();
  File "D:\file_sum\python\Edge-Computing-and-Caching-Optimization-based-on-PPO-for-Task-Offloading-in-RSU-assisted-IoV\run_this\../run_this/run_methods_and_outputs\run_PPO.py", line 239, in run_ppo
    rewards, ma_hit_rate, time_, ma_all_hit_rate = train(args)
  File "D:\file_sum\python\Edge-Computing-and-Caching-Optimization-based-on-PPO-for-Task-Offloading-in-RSU-assisted-IoV\run_this\../run_this/run_methods_and_outputs\run_PPO.py", line 131, in train
    s_, r, done, cur_hitrate, non_caching_hitrate, all_hitrate, time = env.step(a)
  File "D:\file_sum\python\Edge-Computing-and-Caching-Optimization-based-on-PPO-for-Task-Offloading-in-RSU-assisted-IoV\run_this\..\envs\environment.py", line 491, in step
    return np.array(self.state, dtype=np.float32), reward, done, self.get_current_hitrate_reward(
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (191,) + inhomogeneous part.
EscapeTheWind commented 3 months ago

The run_object.py runs correctly without any errors on my PC. Have you set up all the environment for the python project? Or have you changed the variables of the DRL environment?

在我机器上跑是没问题的,Python相关的库你装全了吗,或者有没有改过深度强化学习的环境参数?

EscapeTheWind commented 2 months ago

This error appeared to me when I switch to another PC, currently have no solution, but I guess this error connects to the NumPy module.

ZQ-C commented 1 month ago

Thank you for providing code! But I can't find the paper. Maybe the paper is checking. But I want to have a look to develop my find. Can you give me a link about the paper? Thanks a lot again.

EscapeTheWind commented 1 month ago

You can view the paper at: https://ieeexplore.ieee.org/document/10539436