Oct-26-2024, 09:32 AM
(This post was last modified: Oct-26-2024, 09:41 AM by Yoriz.
Edit Reason: Added code tags
)
Hi, I am working on an algorithm called Augmented random search (ARS) this is its main code:
and I get this error, Can you help me solve this problem?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
def mkdir(base, name): path = os.path.join(base, name) if not os.path.exists(path): os.makedirs(path) return path work_dir = mkdir( "exp" , "brs" ) monitor_dir = mkdir(work_dir, "monitor" ) hp = Hp() np.random.seed(hp.seed) env = gym.make(hp.env_name) env = wrappers.Monitor(env, monitor_dir, force = True ) nb_inputs = env.observation_space.shape[ 0 ] nb_outputs = env.action_space.shape[ 0 ] policy = Policy(nb_inputs, nb_outputs) normalizer = Normalizer(nb_inputs) train(env, policy, normalizer, hp) |
Error:Traceback (most recent call last):
line 134, in <module>
monitor_dir = mkdir(work_dir, "monitor")
^^^^^^^^^^^^^^^^^^^^^^^^^^
line 128, in mkdir
path = os.path.join(base, name)
^^^^^^^^^^^^^^^^^^^^^^^^
line 108, in join
TypeError: expected str, bytes or os.PathLike object, not NoneType
Process finished with exit code 1