hello. I'm running this code and I have some questions.
################################################################################
AutoPentest-DRL: Automated Penetration Testing Using Deep Reinforcement Learning
################################################################################
AutoPentest-DRL: Operation mode: Attack on logical network
AutoPentest-DRL: Target topology: MulVAL_P/logical_topology_1.P
AutoPentest-DRL: Compute attack path for logical network...
Generate attack graph using MulVAL...
Process attack graph into attack matrix...
Traceback (most recent call last):
File "./confirm_path.py", line 9, in
MAP = generateMapClass.sendMap
File "./learn/generateMap.py", line 108, in sendMap
self.x = self.createMatrix()
File "./learn/generateMap.py", line 28, in createMatrix
self.MAP = -(np.ones((self.line, self.line), dtype=np.float))
File "/usr/local/lib/python3.8/dist-packages/numpy/init.py", line 305, in getattr
raise AttributeError(former_attrs[attr])
AttributeError: module 'numpy' has no attribute 'float'.
np.float was a deprecated alias for the builtin float. To avoid this error in existing code, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
/usr/local/lib/python3.8/dist-packages/torch/init__.py:690: UserWarning: torch.set_default_tensor_type() is deprecated as of PyTorch 2.1, please use torch.set_default_dtype() and torch.set_default_device() as alternatives. (Triggered internally at ../torch/csrc/tensor/python_tensor.cpp:451.)
_C._set_default_tensor_type(t)
Traceback (most recent call last):
File "./dqn_learn.py", line 32, in
env = gym.make('dqnenv-v0')
File "/usr/local/lib/python3.8/dist-packages/gym/envs/registration.py", line 581, in make
envcreator = load(spec.entry_point)
File "/usr/local/lib/python3.8/dist-packages/gym/envs/registration.py", line 61, in load
mod = importlib.import_module(mod_name)
File "/usr/lib/python3.8/importlib/init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/motley/Desktop/AutoPentest-DRL-master/DQN/learn/env/environment.py", line 12, in
class dqnEnvironment(gym.Env):
File "/home/motley/Desktop/AutoPentest-DRL-master/DQN/learn/env/environment.py", line 14, in dqnEnvironment
MAP = np.loadtxt('../processdata/newmap.txt')
File "/usr/local/lib/python3.8/dist-packages/numpy/lib/npyio.py", line 1356, in loadtxt
arr = _read(fname, dtype=dtype, comment=comment, delimiter=delimiter,
File "/usr/local/lib/python3.8/dist-packages/numpy/lib/npyio.py", line 975, in _read
fh = np.lib._datasource.open(fname, 'rt', encoding=encoding)
File "/usr/local/lib/python3.8/dist-packages/numpy/lib/_datasource.py", line 193, in open
return ds.open(path, mode, encoding=encoding, newline=newline)
File "/usr/local/lib/python3.8/dist-packages/numpy/lib/_datasource.py", line 533, in open
raise FileNotFoundError(f"{path} not found.")
FileNotFoundError: ../processdata/newmap.txt not found.
I've checked my mulval and it's correctly installed and working. So I don't know how to solve this problem. Please help me.
yours sincerely
hello. I'm running this code and I have some questions. ################################################################################ AutoPentest-DRL: Automated Penetration Testing Using Deep Reinforcement Learning ################################################################################ AutoPentest-DRL: Operation mode: Attack on logical network AutoPentest-DRL: Target topology: MulVAL_P/logical_topology_1.P
AutoPentest-DRL: Compute attack path for logical network... Generate attack graph using MulVAL... Process attack graph into attack matrix... Traceback (most recent call last): File "./confirm_path.py", line 9, in
MAP = generateMapClass.sendMap
File "./learn/generateMap.py", line 108, in sendMap
self.x = self.createMatrix()
File "./learn/generateMap.py", line 28, in createMatrix
self.MAP = -(np.ones((self.line, self.line), dtype=np.float))
File "/usr/local/lib/python3.8/dist-packages/numpy/init.py", line 305, in getattr
raise AttributeError(former_attrs[attr])
AttributeError: module 'numpy' has no attribute 'float'.
env = gym.make('dqnenv-v0')
File "/usr/local/lib/python3.8/dist-packages/gym/envs/registration.py", line 581, in make
envcreator = load(spec.entry_point)
File "/usr/local/lib/python3.8/dist-packages/gym/envs/registration.py", line 61, in load
mod = importlib.import_module(mod_name)
File "/usr/lib/python3.8/importlib/ init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/motley/Desktop/AutoPentest-DRL-master/DQN/learn/env/environment.py", line 12, in
class dqnEnvironment(gym.Env):
File "/home/motley/Desktop/AutoPentest-DRL-master/DQN/learn/env/environment.py", line 14, in dqnEnvironment
MAP = np.loadtxt('../processdata/newmap.txt')
File "/usr/local/lib/python3.8/dist-packages/numpy/lib/npyio.py", line 1356, in loadtxt
arr = _read(fname, dtype=dtype, comment=comment, delimiter=delimiter,
File "/usr/local/lib/python3.8/dist-packages/numpy/lib/npyio.py", line 975, in _read
fh = np.lib._datasource.open(fname, 'rt', encoding=encoding)
File "/usr/local/lib/python3.8/dist-packages/numpy/lib/_datasource.py", line 193, in open
return ds.open(path, mode, encoding=encoding, newline=newline)
File "/usr/local/lib/python3.8/dist-packages/numpy/lib/_datasource.py", line 533, in open
raise FileNotFoundError(f"{path} not found.")
FileNotFoundError: ../processdata/newmap.txt not found.
np.float
was a deprecated alias for the builtinfloat
. To avoid this error in existing code, usefloat
by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, usenp.float64
here. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/local/lib/python3.8/dist-packages/torch/init__.py:690: UserWarning: torch.set_default_tensor_type() is deprecated as of PyTorch 2.1, please use torch.set_default_dtype() and torch.set_default_device() as alternatives. (Triggered internally at ../torch/csrc/tensor/python_tensor.cpp:451.) _C._set_default_tensor_type(t) Traceback (most recent call last): File "./dqn_learn.py", line 32, inI've checked my mulval and it's correctly installed and working. So I don't know how to solve this problem. Please help me. yours sincerely