modestyachts / ARS

An implementation of the Augmented Random Search algorithm
Other
420 stars 103 forks source link

Fixed error of run_policy.py with python 3.6 #6

Open kirk86 opened 6 years ago

kirk86 commented 6 years ago

Fixed error of run_policy.py with python 3.6, lin_policy.items() returns ItemsView in python 3.6, converting to list is not allowed, thus one can use lin_policy.f.arr_0 or lin_policy[lin_policy.files[0]].

dryanguasr commented 5 years ago

It is not hard to solve. I added the list casting to the lin_policy object (around line 23) and then it worked:

lin_policy = np.load(args.expert_policy_file)
lin_policy = list(lin_policy.items())
lin_policy = lin_policy[0][1]