IDSIA / hhmarl_2D

Heterogeneous Hierarchical Multi Agent Reinforcement Learning for Air Combat
67 stars 13 forks source link

The error occurs when I train level=3 and agent_mode=“escape”, because the matrix multiplication does not match #11

Open sakulall opened 2 months ago

sakulall commented 2 months ago
屏幕截图 2024-09-10 143919 屏幕截图 2024-09-10 143956
ardian-selmonaj commented 2 months ago

Hi, based on your images you are inspecting the neural net "Fight1" which won't be used for mode=escape, but rather "Esc1". Try inspecting this network and if you correctly set the configuration. Because I tried escape mode exactly as it is on the master branch and it works. Let me know.

sakulall commented 2 months ago

嗨,根据您的图像,您正在检查神经网络“Fight1”,它不会用于 ,而是“Esc1”。尝试检查此网络,以及是否正确设置了配置。因为我尝试了完全按照 master 分支上的转义模式,并且它有效。请告诉我。mode=escape

我解决了这个问题,我在配置的时候使用的是mode=Escape,结果出现了报错,我后来换成了 mode=escape,就成功了。

sakulall commented 2 months ago

嗨,根据您的图像,您正在检查神经网络“Fight1”,它不会用于 ,而是“Esc1”。尝试检查此网络,以及是否正确设置了配置。因为我尝试了完全按照 master 分支上的转义模式,并且它有效。请告诉我。mode=escape 我想使用render这个配置。 parser.add_argument('--render', type=bool, default=False, help='Render the scene and show live behaviour'),但是我把他设置为True时,没有出现对应的效果,请问该如何实现。

sakulall commented 2 months ago

I have another problem, I used the GPU to train Level 1-3, but when I train Level 4 I get an error, torch.cuda.device_count() is 0, but outside of this project, call torch.cuda.device_count() is 1.

屏幕截图 2024-09-10 155246 屏幕截图 2024-09-10 155345
sakulall commented 2 months ago

Only when I set torch.load to cpu can I run through Level 4.

ardian-selmonaj commented 2 months ago

for GPU: keep your configuration the same throughout training, though I recommend CPU, as Ray is not very consistent with GPU.

for rendering: when you set render=True, there will be stored an image named 'current.png' within the log folder while interacting with the environment. That means, this image gets updated in every step, so while running the code, you can leave this image open and it should appear as "a video" as it is being refreshed. Check the function def evaluate () in train_hetero.py, there is the line env.plot(Path(args.log_path, "current.png")).