浏览代码

pass file mode to h5py.File() (#3165)

* force different versions of h5py in CI

* pass file modes to h5py.File
/asymm-envs
GitHub 5 年前
当前提交
e2ae7124
共有 4 个文件被更改,包括 5 次插入2 次删除
  1. 4
      ml-agents/mlagents/trainers/buffer.py
  2. 1
      test_constraints_max_tf1_version.txt
  3. 1
      test_constraints_max_tf2_version.txt
  4. 1
      test_constraints_min_version.txt

4
ml-agents/mlagents/trainers/buffer.py


"""
Saves the AgentBuffer to a file-like object.
"""
with h5py.File(file_object) as write_file:
with h5py.File(file_object, "w") as write_file:
for key, data in self.items():
write_file.create_dataset(key, data=data, dtype="f", compression="gzip")

"""
with h5py.File(file_object) as read_file:
with h5py.File(file_object, "r") as read_file:
for key in list(read_file.keys()):
self[key] = AgentBuffer.AgentBufferField()
# extend() will convert the numpy array's first dimension into list

1
test_constraints_max_tf1_version.txt


grpcio>=1.23.0
numpy>=1.17.2
tensorflow>=1.14.0,<2.0
h5py>=2.10.0

1
test_constraints_max_tf2_version.txt


grpcio>=1.23.0
numpy>=1.17.2
tensorflow>=2.0.0,<2.1.0
h5py>=2.10.0

1
test_constraints_min_version.txt


Pillow==4.2.1
protobuf==3.6
tensorflow==1.7
h5py==2.9.0
正在加载...
取消
保存