We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IndexError: list index out of range
https://github.com/tensorlayer/tensorlayer/blob/master/examples/reinforcement_learning/tutorial_PG.py Because of the previous issue AttributeError: 'str' object has no attribute 'decode' , I modified code of \tensorlayer\files\utils.py, line 2617 to weight_names = [n if isinstance(n, str) else n.decode('utf8') for n in f.attrs["layer_names"]] then :
\tensorlayer\files\utils.py
weight_names = [n if isinstance(n, str) else n.decode('utf8') for n in f.attrs["layer_names"]]
Traceback (most recent call last): File "D:/Tony/Documents/yunpan/invest/2022/quant/gym/study PG/PG/pg.py", line 219, in <module> agent.load() File "D:/Tony/Documents/yunpan/invest/2022/quant/gym/study PG/PG/pg.py", line 161, in load tl.files.load_hdf5_to_weights_in_order(os.path.join(path, 'pg_policy.hdf5'), self.model) File "D:\Anaconda3\envs\gym_env\lib\site-packages\tensorlayer\files\utils.py", line 2729, in load_hdf5_to_weights_in_order _load_weights_from_hdf5_group_in_order(f, network.all_layers) File "D:\Anaconda3\envs\gym_env\lib\site-packages\tensorlayer\files\utils.py", line 2618, in _load_weights_from_hdf5_group_in_order assign_tf_variable(layer.all_weights[iid], np.asarray(g[w_name])) IndexError: list index out of range
The text was updated successfully, but these errors were encountered:
No branches or pull requests
New Issue Checklist
Issue Description
IndexError: list index out of range
Reproducible Code
windows 10 professional
tensorlayer: 2.2.5
tensorflow : 2.8
python:3.7
https://github.com/tensorlayer/tensorlayer/blob/master/examples/reinforcement_learning/tutorial_PG.py
Because of the previous issue AttributeError: 'str' object has no attribute 'decode' , I modified code of
\tensorlayer\files\utils.py
, line 2617 toweight_names = [n if isinstance(n, str) else n.decode('utf8') for n in f.attrs["layer_names"]]
then :The text was updated successfully, but these errors were encountered: