Keras RetinaNet github项目
https://github.com/fizyr/keras-retinanet 根据此网站的方法,利用Pascal VOC 2007数据集开始训练,出现error:
D:\JupyterWorkSpace\keras-retinanet>python D:\\JupyterWorkSpace\\keras-retinanet\\keras_retinanet\\bin\\train.py pascal D:\\JupyterWorkSpace\\VOCdevkit\\VOC2007 --steps 100
C:\ProgramData\Anaconda3\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
Using TensorFlow backend.
Traceback (most recent call last):
File "D:\\JupyterWorkSpace\\keras-retinanet\\keras_retinanet\\bin\\train.py", line 35, in <module>
from .. import layers # noqa: F401
File "D:\\JupyterWorkSpace\\keras-retinanet\\keras_retinanet\\bin\..\..\keras_retinanet\layers\__init__.py", line 1, in <module>
from ._misc import RegressBoxes, UpsampleLike, Anchors, ClipBoxes # noqa: F401
File "D:\\JupyterWorkSpace\\keras-retinanet\\keras_retinanet\\bin\..\..\keras_retinanet\layers\_misc.py", line 19, in <module>
from ..utils import anchors as utils_anchors
File "D:\\JupyterWorkSpace\\keras-retinanet\\keras_retinanet\\bin\..\..\keras_retinanet\utils\anchors.py", line 20, in <module>
from ..utils.compute_overlap import compute_overlap
ModuleNotFoundError: No module named 'keras_retinanet.utils.compute_overlap'
在anchors.py中的from ..utils.compute_overlap import compute_overlap之前加入
import pyximport
pyximport.install()
再运行,出现如下error:
D:\JupyterWorkSpace\keras-retinanet>python D:\\JupyterWorkSpace\\keras-retinanet\\keras_retinanet\\bin\\train.py pascal D:\\JupyterWorkSpace\\VOCdevkit\\VOC2007 --steps 100
C:\ProgramData\Anaconda3\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
Using TensorFlow backend.
compute_overlap.c
C:\Users\Administrator\.pyxbld\temp.win-amd64-3.6\Release\pyrex\keras_retinanet\utils\compute_overlap.c(567): fatal error C1083: Cannot open include file: 'numpy/arrayobject.h': No such file or directory
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\distutils\_msvccompiler.py", line 423, in compile
self.spawn(args)
File "C:\ProgramData\Anaconda3\lib\distutils\_msvccompiler.py", line 542, in spawn
return super().spawn(cmd)
File "C:\ProgramData\Anaconda3\lib\distutils\ccompiler.py", line 909, in spawn
spawn(cmd, dry_run=self.dry_run)
File "C:\ProgramData\Anaconda3\lib\distutils\spawn.py", line 38, in spawn
_spawn_nt(cmd, search_path, dry_run=dry_run)
File "C:\ProgramData\Anaconda3\lib\distutils\spawn.py", line 81, in _spawn_nt
"command %r failed with exit status %d" % (cmd, rc))
distutils.errors.DistutilsExecError: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2 During handling of the above exception, another exception occurred: Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\pyximport\pyximport.py", line 215, in load_module
inplace=build_inplace, language_level=language_level)
File "C:\ProgramData\Anaconda3\lib\site-packages\pyximport\pyximport.py", line 191, in build_module
reload_support=pyxargs.reload_support)
File "C:\ProgramData\Anaconda3\lib\site-packages\pyximport\pyxbuild.py", line 102, in pyx_to_dll
dist.run_commands()
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\ProgramData\Anaconda3\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run
_build_ext.build_ext.run(self)
File "C:\ProgramData\Anaconda3\lib\distutils\command\build_ext.py", line 339, in run
self.build_extensions()
File "C:\ProgramData\Anaconda3\lib\site-packages\Cython\Distutils\old_build_ext.py", line 194, in build_extensions
self.build_extension(ext)
File "C:\ProgramData\Anaconda3\lib\distutils\command\build_ext.py", line 533, in build_extension
depends=ext.depends)
File "C:\ProgramData\Anaconda3\lib\distutils\_msvccompiler.py", line 425, in compile
raise CompileError(msg)
distutils.errors.CompileError: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2 During handling of the above exception, another exception occurred: Traceback (most recent call last):
File "D:\\JupyterWorkSpace\\keras-retinanet\\keras_retinanet\\bin\\train.py", line 35, in <module>
from .. import layers # noqa: F401
File "D:\\JupyterWorkSpace\\keras-retinanet\\keras_retinanet\\bin\..\..\keras_retinanet\layers\__init__.py", line 1, in <module>
from ._misc import RegressBoxes, UpsampleLike, Anchors, ClipBoxes # noqa: F401
File "D:\\JupyterWorkSpace\\keras-retinanet\\keras_retinanet\\bin\..\..\keras_retinanet\layers\_misc.py", line 19, in <module>
from ..utils import anchors as utils_anchors
File "D:\\JupyterWorkSpace\\keras-retinanet\\keras_retinanet\\bin\..\..\keras_retinanet\utils\anchors.py", line 22, in <module>
from ..utils.compute_overlap import compute_overlap
File "C:\ProgramData\Anaconda3\lib\site-packages\pyximport\pyximport.py", line 458, in load_module
language_level=self.language_level)
File "C:\ProgramData\Anaconda3\lib\site-packages\pyximport\pyximport.py", line 231, in load_module
raise exc.with_traceback(tb)
File "C:\ProgramData\Anaconda3\lib\site-packages\pyximport\pyximport.py", line 215, in load_module
inplace=build_inplace, language_level=language_level)
File "C:\ProgramData\Anaconda3\lib\site-packages\pyximport\pyximport.py", line 191, in build_module
reload_support=pyxargs.reload_support)
File "C:\ProgramData\Anaconda3\lib\site-packages\pyximport\pyxbuild.py", line 102, in pyx_to_dll
dist.run_commands()
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\ProgramData\Anaconda3\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run
_build_ext.build_ext.run(self)
File "C:\ProgramData\Anaconda3\lib\distutils\command\build_ext.py", line 339, in run
self.build_extensions()
File "C:\ProgramData\Anaconda3\lib\site-packages\Cython\Distutils\old_build_ext.py", line 194, in build_extensions
self.build_extension(ext)
File "C:\ProgramData\Anaconda3\lib\distutils\command\build_ext.py", line 533, in build_extension
depends=ext.depends)
File "C:\ProgramData\Anaconda3\lib\distutils\_msvccompiler.py", line 425, in compile
raise CompileError(msg)
ImportError: Building module keras_retinanet.utils.compute_overlap failed: ["distutils.errors.CompileError: command 'C:\\\\Program Files (x86)\\\\Microsoft Visual Studio 14.0\\\\VC\\\\BIN\\\\x86_amd64\\\\cl.exe' failed with exit status 2\n"]
我猜测python调用c在Windows系统上bug比较多,还好这个Keras RetinaNet github项目的旧版本没有调用c,索性就用旧版本。
但是又出现问题:
Limit: 1551050342
InUse: 1548747008
MaxInUse: 1549328640
NumAllocs: 1403
MaxAllocSize: 119565824 2018-07-31 13:42:42.065436: W C:\tf_jenkins\home\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\common_runtime\bfc_allocator.cc:277] ****************************************************************************************************
2018-07-31 13:42:42.081028: W C:\tf_jenkins\home\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\framework\op_kernel.cc:1192] Resource exhausted: OOM when allocating tensor with shape[1,512,100,101]
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1323, in _do_call
return fn(*args)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1302, in _run_fn
status, run_metadata)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 473, in __exit__
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.ResourceExhaustedError: OOM when allocating tensor with shape[1,512,100,101]
[[Node: bn3a_branch2c/FusedBatchNorm = FusedBatchNorm[T=DT_FLOAT, data_format="NHWC", epsilon=1.001e-05, is_training=false, _device="/job:localhost/replica:0/task:0/device:GPU:0"](res3a_branch2c/convolution, bn3a_branch2c/gamma/read, bn3a_branch2c/beta/read, bn3a_branch2c/moving_mean/read, bn3a_branch2c/moving_variance/read)]]
[[Node: loss/add/_2253 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_8646_loss/add", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]] During handling of the above exception, another exception occurred: Traceback (most recent call last):
File "D:\\JupyterWorkSpace\\keras-retinanet\\keras_retinanet\\bin\\train.py", line 443, in <module>
main()
File "D:\\JupyterWorkSpace\\keras-retinanet\\keras_retinanet\\bin\\train.py", line 438, in main
callbacks=callbacks,
File "C:\ProgramData\Anaconda3\lib\site-packages\keras\legacy\interfaces.py", line 91, in wrapper
return func(*args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\keras\engine\training.py", line 1415, in fit_generator
initial_epoch=initial_epoch)
File "C:\ProgramData\Anaconda3\lib\site-packages\keras\engine\training_generator.py", line 213, in fit_generator
class_weight=class_weight)
File "C:\ProgramData\Anaconda3\lib\site-packages\keras\engine\training.py", line 1215, in train_on_batch
outputs = self.train_function(ins)
File "C:\ProgramData\Anaconda3\lib\site-packages\keras\backend\tensorflow_backend.py", line 2672, in __call__
return self._legacy_call(inputs)
File "C:\ProgramData\Anaconda3\lib\site-packages\keras\backend\tensorflow_backend.py", line 2654, in _legacy_call
**self.session_kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 889, in run
run_metadata_ptr)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1120, in _run
feed_dict_tensor, options, run_metadata)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1317, in _do_run
options, run_metadata)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1336, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.ResourceExhaustedError: OOM when allocating tensor with shape[1,512,100,101]
[[Node: bn3a_branch2c/FusedBatchNorm = FusedBatchNorm[T=DT_FLOAT, data_format="NHWC", epsilon=1.001e-05, is_training=false, _device="/job:localhost/replica:0/task:0/device:GPU:0"](res3a_branch2c/convolution, bn3a_branch2c/gamma/read, bn3a_branch2c/beta/read, bn3a_branch2c/moving_mean/read, bn3a_branch2c/moving_variance/read)]]
[[Node: loss/add/_2253 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_8646_loss/add", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]] Caused by op 'bn3a_branch2c/FusedBatchNorm', defined at:
File "D:\\JupyterWorkSpace\\keras-retinanet\\keras_retinanet\\bin\\train.py", line 443, in <module>
main()
File "D:\\JupyterWorkSpace\\keras-retinanet\\keras_retinanet\\bin\\train.py", line 410, in main
freeze_backbone=args.freeze_backbone
File "D:\\JupyterWorkSpace\\keras-retinanet\\keras_retinanet\\bin\\train.py", line 87, in create_models
model = model_with_weights(backbone_retinanet(num_classes, modifier=modifier), weights=weights, skip_mismatch=True)
File "D:\\JupyterWorkSpace\\keras-retinanet\\keras_retinanet\\bin\..\..\keras_retinanet\models\resnet.py", line 33, in retinanet
return resnet_retinanet(*args, backbone=self.backbone, **kwargs)
File "D:\\JupyterWorkSpace\\keras-retinanet\\keras_retinanet\\bin\..\..\keras_retinanet\models\resnet.py", line 75, in resnet_retinanet
resnet = keras_resnet.models.ResNet50(inputs, include_top=False, freeze_bn=True)
File "C:\Users\Administrator\AppData\Roaming\Python\Python36\site-packages\keras_resnet\models\_2d.py", line 188, in ResNet50
return ResNet(inputs, blocks, numerical_names=numerical_names, block=keras_resnet.blocks.bottleneck_2d, include_top=include_top, classes=classes, *args, **kwargs)
File "C:\Users\Administrator\AppData\Roaming\Python\Python36\site-packages\keras_resnet\models\_2d.py", line 76, in ResNet
x = block(features, stage_id, block_id, numerical_name=(block_id > 0 and numerical_names[stage_id]), freeze_bn=freeze_bn)(x)
File "C:\Users\Administrator\AppData\Roaming\Python\Python36\site-packages\keras_resnet\blocks\_2d.py", line 139, in f
y = keras_resnet.layers.BatchNormalization(axis=axis, epsilon=1e-5, freeze=freeze_bn, name="bn{}{}_branch2c".format(stage_char, block_char))(y)
File "C:\ProgramData\Anaconda3\lib\site-packages\keras\engine\base_layer.py", line 457, in __call__
output = self.call(inputs, **kwargs)
File "C:\Users\Administrator\AppData\Roaming\Python\Python36\site-packages\keras_resnet\layers\_batch_normalization.py", line 17, in call
return super(BatchNormalization, self).call(training=(not self.freeze), *args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\keras\layers\normalization.py", line 178, in call
return normalize_inference()
File "C:\ProgramData\Anaconda3\lib\site-packages\keras\layers\normalization.py", line 174, in normalize_inference
epsilon=self.epsilon)
File "C:\ProgramData\Anaconda3\lib\site-packages\keras\backend\tensorflow_backend.py", line 1905, in batch_normalization
is_training=False
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\ops\nn_impl.py", line 831, in fused_batch_norm
name=name)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\ops\gen_nn_ops.py", line 2033, in _fused_batch_norm
is_training=is_training, name=name)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 2956, in create_op
op_def=op_def)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 1470, in __init__
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access ResourceExhaustedError (see above for traceback): OOM when allocating tensor with shape[1,512,100,101]
[[Node: bn3a_branch2c/FusedBatchNorm = FusedBatchNorm[T=DT_FLOAT, data_format="NHWC", epsilon=1.001e-05, is_training=false, _device="/job:localhost/replica:0/task:0/device:GPU:0"](res3a_branch2c/convolution, bn3a_branch2c/gamma/read, bn3a_branch2c/beta/read, bn3a_branch2c/moving_mean/read, bn3a_branch2c/moving_variance/read)]]
[[Node: loss/add/_2253 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_8646_loss/add", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]
cmd上显示的电脑条件如下:
2018-07-31 13:41:32.294261: I C:\tf_jenkins\home\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\platform\cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX
2018-07-31 13:41:32.924335: I C:\tf_jenkins\home\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\common_runtime\gpu\gpu_device.cc:1030] Found device 0 with properties:
name: GeForce GT 740 major: 3 minor: 0 memoryClockRate(GHz): 1.0585
pciBusID: 0000:01:00.0
totalMemory: 2.00GiB freeMemory: 1.66GiB
2018-07-31 13:41:32.931511: I C:\tf_jenkins\home\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\common_runtime\gpu\gpu_device.cc:1120] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: GeForce GT 740, pci bus id: 0000:01:00.0, compute capability: 3.0)
出现错误的原因应该是GPU内存太小,所以还需要换个更好的GPU。
Keras RetinaNet github项目的更多相关文章
- Keras RetinaNet github项目安装
在存储库目录/keras-retinanet/中,执行pip install . --user 后,出现错误: D:\>cd D:\JupyterWorkSpace\keras-retinane ...
- 利用Travis CI 让你的github项目持续构建
Travis CI 是目前新兴的开源持续集成构建项目,它与jenkins,GO的很明显的特别在于采用yaml格式,简洁清新独树一帜.目前大多数的github项目都已经移入到Travis CI的构建队列 ...
- 优秀大数据GitHub项目一览
http://blog.csdn.net/yaoxtao/article/details/50540485 优秀大数据GitHub项目一览 VMware CEO Pat Gelsinger曾说: 数据 ...
- 用tortoiseGit管理GitHub项目代码(完整教程)
一.为什么要写这篇博客呢,因为在一开始用tortoiseGit来管理项目的时候,在百度上找了很多教程,但是感觉说的都不是很全,有些东西以及操作没写清楚,所以想写一片比较完整用tortoiseGit管理 ...
- Github项目推荐-图神经网络(GNN)相关资源大列表
文章发布于公号[数智物语] (ID:decision_engine),关注公号不错过每一篇干货. 转自 | AI研习社 作者|Zonghan Wu 这是一个与图神经网络相关的资源集合.相关资源浏览下方 ...
- Eclipse安装git插件以及关联导入GitHub项目
一.Eclipse配置git 1.查看自己eclipse的版本 打开eclipse 导航: help->AboutEclipse 如图: 2.检查Eclipse中是否已安装Git插件 菜单栏He ...
- github项目
一.github项目地址: https://github.com/fairy1231/gitLearning/tree/master 二.github的重要性: Git 是一个快速.可扩展的分布式版本 ...
- 【全网最全的博客美化系列教程】01.添加Github项目链接
全网最全的博客美化系列教程相关文章目录 [全网最全的博客美化系列教程]01.添加Github项目链接 [全网最全的博客美化系列教程]02.添加QQ交谈链接 [全网最全的博客美化系列教程]03.给博客添 ...
- 使用IntelliJ IDEA和Eclipse导入Github项目
使用IntelliJ IDEA导入Github项目 菜单栏File->Settings->分别配置好Github和Git的相关信息,配置完之后点击旁边的Test按键可以查看是否配置成功 配 ...
随机推荐
- 论文阅读笔记四十二:Going deeper with convolutions (Inception V1 CVPR2014 )
论文原址:https://arxiv.org/pdf/1409.4842.pdf 代码连接:https://github.com/titu1994/Inception-v4(包含v1,v2,v4) ...
- PHP实现微信商户支付企业付款到零钱功能代码实例
本文为大家分享了PHP实现微信商户支付企业付款到零钱的具体代码,供大家参考,具体内容如下 微信支付开发文档 一.开通条件 企业付款为企业提供付款至用户零钱的能力,支持通过API接口付款,或通过微信支付 ...
- koa
koa 链接: 官网: https://koa.bootcss.com/# 入门: http://www.ruanyifeng.com/blog/2017/08/koa.html 进阶: https: ...
- UOJ#36. 【清华集训2014】玛里苟斯 线性基
原文链接https://www.cnblogs.com/zhouzhendong/p/UOJ36.html 题解 按照 $k$ 分类讨论: k=1 : 我们考虑每一位的贡献.若有至少一个数第 $i$ ...
- Scrapy基础(十四)————知乎模拟登陆
#-*-coding:utf-8 -*-__author__ = "ruoniao"__date__ = "2017/5/31 20:59" 之前我们通过爬取伯 ...
- centos6.5安装nginx+python+uwsgi+django
nginx+uwsgi+django环境部署及测试 默认系统自带的python2.6.6 第一步(安装setuptools) wget https://pypi.python.org/packages ...
- Python: 你不知道的 super
https://segmentfault.com/a/1190000007426467 Python: 你不知道的 super 在类的继承中,如果重定义某个方法,该方法会覆盖父类的同名方法,但有时,我 ...
- Matrix [POJ3685] [二分套二分]
Description 有一个N阶方阵 第i行,j列的值Aij =i2 + 100000 × i + j2 - 100000 × j + i × j,需要找出这个方阵的第M小值. Input 第一行输 ...
- JS节流和防抖
事件的触发权很多时候都属于用户,有些情况下会产生问题: 向后台发送数据,用户频繁触发,对服务器造成压力 一些浏览器事件:window.onresize.window.mousemove等,触发的频率非 ...
- linux中vi编辑
crt退出全屏:点击Alt+enter键 linux上传下载文件 Xftp.Filezilla.Winscp等工具 命令 sz test.txt #下载test.txt文件 ...