MorvanZhou / pytorch-A3C

Simple A3C implementation with pytorch + multiprocessing

Home Page:https://mofanpy.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The discrete_A3C.py is not working...

Petrelli opened this issue · comments

commented

I got this error:

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/Petrelli/Desktop/Research/code/pytorch-A3C/continuous_A3C.py", line 88, in run
a = self.lnet.choose_action(v_wrap(s[None, :]))
TypeError: tuple indices must be integers or slices, not tuple

Then I just changed the line 85 to a = self.lnet.choose_action(v_wrap(s[None :]))

However, another error comes...

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/Petrelli/Desktop/Research/code/pytorch-A3C/discrete_A3C.py", line 85, in run
a = self.lnet.choose_action(v_wrap(s[None :]))
File "/Users/Petrelli/Desktop/Research/code/pytorch-A3C/utils.py", line 11, in v_wrap
if np_array.dtype != dtype:
AttributeError: 'tuple' object has no attribute 'dtype'

Not sure if it is the python version's reason (I used python 3.9 and 3.10 to run the code, on Mac).

commented

it was the Mac M1 silicon's reason...

i get the same error. Win11+intel i9. "TypeError: tuple indices must be integers or slices, not tuple" on " a = self.lnet.choose_action(v_wrap(s[None, :]))
"