AlirezaShamsoshoara / Reinforcement_Learning_Team_Q_learnig_MARL_Multi_Agent_UAV_Spectrum_task

A solution for Dynamic Spectrum Management in Mission-Critical UAV Networks using Team Q learning as a Multi-Agent Reinforcement Learning Approach
61 stars 18 forks source link

i found some question #1

Open syue0225 opened 3 years ago

syue0225 commented 3 years ago

when i run it ,it have some problems File "E:/python_code/Reinforcement_Learning_Team_Q_learnig_MARL_Multi_Agent_UAV_Spectrum_task-main/Reinforcement_Learning_Team_Q_learnig_MARL_Multi_Agent_UAV_Spectrum_task-main/main.py", line 174, in csi_coef = get_csi(num_UAV, loc_dict, X_Mat[Step, Eps, :], Y_Mat[Step, Eps, :]) File "E:\python_code\Reinforcement_Learning_Team_Q_learnig_MARL_Multi_Agent_UAV_Spectrum_task-main\Reinforcement_Learning_Team_Q_learnig_MARL_Multi_Agent_UAV_Spectrum_task-main\csi.py", line 158, in get_csi csi_h[:, source_uav] = np.squeeze(h_S_uav) ValueError: could not broadcast input array from shape (2,2) into shape (2)

could you help me?

AlirezaShamsoshoara commented 3 years ago

@syue0225, Did you change any variables? How many UAVs you have? Keep track of the X and Y Matrices, then see what are the shapes of variables and what values they have? It is better to do it in debug mode.

digaamberdhamija commented 2 years ago

The issue is in lines 145, 148, 151, and 154 of the file csi.py. The transpose operation to the second argument of np.multiply should not be there as it will produce an output with the wrong dimensions. I have checked and verified the results.

purbe commented 2 years ago

when i run it ,it have some problems File "E:/python_code/Reinforcement_Learning_Team_Q_learnig_MARL_Multi_Agent_UAV_Spectrum_task-main/Reinforcement_Learning_Team_Q_learnig_MARL_Multi_Agent_UAV_Spectrum_task-main/main.py", line 174, in csi_coef = get_csi(num_UAV, loc_dict, X_Mat[Step, Eps, :], Y_Mat[Step, Eps, :]) File "E:\python_code\Reinforcement_Learning_Team_Q_learnig_MARL_Multi_Agent_UAV_Spectrum_task-main\Reinforcement_Learning_Team_Q_learnig_MARL_Multi_Agent_UAV_Spectrum_task-main\csi.py", line 158, in get_csi csi_h[:, source_uav] = np.squeeze(h_S_uav) ValueError: could not broadcast input array from shape (2,2) into shape (2)

could you help me?

are you able to rectify the error, bcz i'm facing the same issure? plz help me

purbe commented 2 years ago

The issue is in lines 145, 148, 151, and 154 of the file csi.py. The transpose operation to the second argument of np.multiply should not be there as it will produce an output with the wrong dimensions. I have checked and verified the results.

hey can you help me? after removing transpose still getting the same error. does your code working?

1234Crystal commented 2 years ago

Traceback (most recent call last): File "E:/Reinforcement_Learning_Team_Q_learnig_MARL_Multi_Agent_UAV_Spectrum_task-main/main.py", line 272, in next_state_index=next_state_index, task_diff=task_diff, qVal=qVal) File "<__array_function__ internals>", line 6, in savez File "D:\Anaconda3\envs\python37\lib\site-packages\numpy\lib\npyio.py", line 618, in savez _savez(file, args, kwds, False) File "D:\Anaconda3\envs\python37\lib\site-packages\numpy\lib\npyio.py", line 715, in _savez zipf = zipfile_factory(file, mode="w", compression=compression) File "D:\Anaconda3\envs\python37\lib\site-packages\numpy\lib\npyio.py", line 112, in zipfile_factory return zipfile.ZipFile(file, *args, **kwargs) File "D:\Anaconda3\envs\python37\lib\zipfile.py", line 1240, in init self.fp = io.open(file, filemode) FileNotFoundError: [Errno 2] No such file or directory: '\data\Out_greedy_Size_10_Run_0_Eps_200_Step_30000.npz'

The file doesn't have Out_greedy_Size_10_Run_0_Eps_200_Step_30000.npz,so what's the problem?Can you help me?