crond-jaist / AutoPentest-DRL

AutoPentest-DRL: Automated Penetration Testing Using Deep Reinforcement Learning
BSD 3-Clause "New" or "Revised" License
331 stars 82 forks source link

IndexError: index 6 is out of bounds for axis 0 with size 1 #11

Open Arashiailing opened 1 year ago

Arashiailing commented 1 year ago

Hi,I'm trying to run the code,but found multiple errors,such as 1.module 'numpy' has no attribute 'float' 2.IndexError: index 6 is out of bounds for axis 0 with size 1 May I ask you about numpy's version?

crond-jaist commented 1 year ago

Hi,

Thanks for reporting. I was able to confirm your issue, which is caused by a recent change in the numpy library. See the link below for more details: https://levelup.gitconnected.com/fix-attributeerror-module-numpy-has-no-attribute-float-d7d68c5a4971

To fix this you simply need to replace "np.float" with "float" in the files DQN/learn/generateMap.py and DQN/confirm_path.py.

The problem is then solved, but I encountered some new issues related to changes in the gym library. The error was the following: AssertionError: The environment must specify an observation space. https://www.gymlibrary.dev/content/environment_creation/

I tried some quick fixes, but it didn't work, so I was not able to solve the issue, and the student who developed this system left our university a couple of years ago. I may find the time to fix this in the future, but for now you can try to fix the issue by yourself if you can find a way.

Best wishes, Razvan

Arashiailing commented 1 year ago

Thanks for your reply. Actually I meet a lot of problems. I would try to find them out. 

---Original--- From: "Cyber Range Organization and Design @.> Date: Fri, Feb 24, 2023 12:04 PM To: @.>; Cc: @.**@.>; Subject: Re: [crond-jaist/AutoPentest-DRL] IndexError: index 6 is out ofbounds for axis 0 with size 1 (Issue #11)

Hi,

Thanks for reporting. I was able to confirm your issue, which is caused by a recent change in the numpy library. See the link below for more details: https://levelup.gitconnected.com/fix-attributeerror-module-numpy-has-no-attribute-float-d7d68c5a4971

To fix this you simply need to replace "np.float" with "float" in the files DQN/learn/generateMap.py and DQN/confirm_path.py.

The problem is then solved, but I encountered some new issues related to changes in the gym library. The error was the following: AssertionError: The environment must specify an observation space. https://www.gymlibrary.dev/content/environment_creation/

I tried some quick fixes, but it didn't work, so I was not able to solve the issue, and the student who developed this system left our university a couple of years ago. I may find the time to fix this in the future, but for now you can try to fix the issue by yourself if you can find a way.

Best wishes, Razvan

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

Arashiailing commented 1 year ago

I change the version and add to the requirements.txt and the problem is sloved.There is my version gym==0.13.0 torch==1.10.2 matplotlib==3.3.4 graphviz==0.19.1 jinja2==3.0.3 msgpack==1.0.4 requests==2.18.4

crond-jaist commented 1 year ago

Hi, Thank you for investigating the issue and posting the requirements.txt file. I shall test it on my side as well in the following weeks, and if everything goes well I'll update the file in the repository. I'll keep this issue open for now though, until I get to update the repository. Best wishes, Razvan