site-packages\h5py\__init__.py:36: FutureWarning

1.错误:

D:\Program Files\python3.6\lib\site-packages\h5py\__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.   from ._conv import register_converters as _register_converters

2.原因:(参考:https://wuwb.me/2018/03/h5py-futurewarning-problem-fix.html

h5py 和 numpy 版本冲突,h5py 官方已修复合并到 master 分支,但是还没发新版,在发版之前可以用降级 numpy 的方法跳过这个问题。降级命令如下:

pip install numpy==1.13.3(tensorflow-gpu 1.6.0 匹配numpy 1.13.3)
Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\Scripts\pip-script.py", line 9, in <module> load_entry_point('pip==8.1.2', 'console_scripts', 'pip')() File "c:\users\administrator\appdata\local\programs\python\python35\lib\site-packages\pkg_resources\__init__.py", line 558, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "c:\users\administrator\appdata\local\programs\python\python35\lib\site-packages\pkg_resources\__init__.py", line 2682, in load_entry_point return ep.load() File "c:\users\administrator\appdata\local\programs\python\python35\lib\site-packages\pkg_resources\__init__.py", line 2355, in load return self.resolve() File "c:\users\administrator\appdata\local\programs\python\python35\lib\site-packages\pkg_resources\__init__.py", line 2361, in resolve module = __import__(self.module_name, fromlist=['__name__'], level=0) File "c:\users\administrator\appdata\local\programs\python\python35\lib\site-packages\pip-8.1.2-py3.5.egg\pip\__init__.py", line 18, in <module> from pip.commands import get_summaries, get_similar_commands File "c:\users\administrator\appdata\local\programs\python\python35\lib\site-packages\pip-8.1.2-py3.5.egg\pip\commands\__init__.py", line 14, in <module> from pip.commands.install import InstallCommand File "c:\users\administrator\appdata\local\programs\python\python35\lib\site-packages\pip-8.1.2-py3.5.egg\pip\commands\install.py", line 10, in <module> import wheel File "c:\users\administrator\appdata\local\programs\python\python35\lib\site-packages\wheel\__init__.py", line 1 from __future__ import annotations SyntaxError: future feature annotations is not defined
07-14
--------------------------------------------------------------------------- OSError Traceback (most recent call last) <ipython-input-41-76f2930386d7> in <module>() ----> 1 model.save('CNN_CIFAR10_model_h5') D:\360downloads\Anaconda\envs\tensorflow_cpu\lib\site-packages\keras\engine\network.py in save(self, filepath, overwrite, include_optimizer) 1088 raise NotImplementedError 1089 from ..models import save_model -> 1090 save_model(self, filepath, overwrite, include_optimizer) 1091 1092 def save_weights(self, filepath, overwrite=True): D:\360downloads\Anaconda\envs\tensorflow_cpu\lib\site-packages\keras\engine\saving.py in save_model(model, filepath, overwrite, include_optimizer) 377 opened_new_file = False 378 --> 379 f = h5dict(filepath, mode='w') 380 381 try: D:\360downloads\Anaconda\envs\tensorflow_cpu\lib\site-packages\keras\utils\io_utils.py in __init__(self, path, mode) 184 self._is_file = False 185 elif isinstance(path, str): --> 186 self.data = h5py.File(path, mode=mode) 187 self._is_file = True 188 elif isinstance(path, dict): D:\360downloads\Anaconda\envs\tensorflow_cpu\lib\site-packages\h5py\_hl\files.py in __init__(self, name, mode, driver, libver, userblock_size, swmr, rdcc_nslots, rdcc_nbytes, rdcc_w0, track_order, **kwds) 406 fid = make_fid(name, mode, userblock_size, 407 fapl, fcpl=make_fcpl(track_order=track_order), --> 408 swmr=swmr) 409 410 if isinstance(libver, tuple): D:\360downloads\Anaconda\envs\tensorflow_cpu\lib\site-packages\h5py\_hl\files.py in make_fid(name, mode, userblock_size, fapl, fcpl, swmr) 177 fid = h5f.create(name, h5f.ACC_EXCL, fapl=fapl, fcpl=fcpl) 178 elif mode == 'w': --> 179 fid = h5f.create(name, h5f.ACC_TRUNC, fapl=fapl, fcpl=fcpl) 180 elif mode == 'a': 181 # Open in append mode (read/write). h5py\_objects.pyx in h5py._objects.with_phil.wrapper() h5py\_objects.pyx in h5py._objects.with_phil.wrapper() h5py\h5f.pyx in h5py.h5f.create() OSError: Unable to create file (unable to truncate a file which is already open)
07-13
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

GL_Rain

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值