|
本帖最后由 xsky 于 2019-12-12 17:20 编辑
- # pre-process config
- print('--> config model')
- rknn.config(batch_size=1, channel_mean_value='123 117 104 1', reorder_channel='0 1 2', epochs=100, quantized_dtype='asymmetric_quantized-u8')
- print('done')
- model_file = '../XMC2-Det_student_detector.pth.tar_op-v9.onnx'
- print('--> Loading model', model_file)
- ret = rknn.load_onnx(model=model_file)
- if ret != 0:
- print('Load model failed!')
- exit(ret)
- print('done')
- if ret != 0:
- print('Load model failed!')
- exit(ret)
- print('done')
- # Build model
- print('--> hybrid_quantization_step1')
- ret = rknn.hybrid_quantization_step1(dataset='./dataset.txt')
- if ret != 0:
- print('hybrid_quantization_step1 failed!')
- exit(ret)
- print('done')
输入错误信息:
W Warning: Axis may need to be adjusted according to original model shape.
W Warning: Axis may need to be adjusted according to original model shape.
W Unhandle status: the input shape of reshape layer Reshape_125_3 is not 4-D
W Warning: Axis may need to be adjusted according to original model shape.
W Warning: Axis may need to be adjusted according to original model shape.
W Unhandle status: the input shape of reshape layer Reshape_126_4 is not 4-D
W Warning: Axis may need to be adjusted according to original model shape.
W:tensorflow:From D:\Program Files\Python\Python36\lib\site-packages\rknn\api\rknn.py:194: add_dispatch_support.<locals>.wrapper (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.where in 2.0, which has the same broadcast rule as np.where
2019-12-12 17:06:39.913429: E tensorflow/stream_executor/cuda/cuda_driver.cc:890] failed to alloc 4294967296 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2019-12-12 17:06:39.917815: W .\tensorflow/core/common_runtime/gpu/gpu_host_allocator.h:44] could not allocate pinned host memory of size: 4294967296
2019-12-12 17:06:39.937048: E tensorflow/stream_executor/cuda/cuda_driver.cc:890] failed to alloc 3865470464 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2019-12-12 17:06:39.941542: W .\tensorflow/core/common_runtime/gpu/gpu_host_allocator.h:44] could not allocate pinned host memory of size: 3865470464
2019-12-12 17:06:39.959247: E tensorflow/stream_executor/cuda/cuda_driver.cc:890] failed to alloc 3478923264 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2019-12-12 17:06:39.963639: W .\tensorflow/core/common_runtime/gpu/gpu_host_allocator.h:44] could not allocate pinned host memory of size: 3478923264
2019-12-12 17:06:47.350046: E tensorflow/stream_executor/cuda/cuda_driver.cc:890] failed to alloc 8589934592 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2019-12-12 17:06:47.355453: W .\tensorflow/core/common_runtime/gpu/gpu_host_allocator.h:44] could not allocate pinned host memory of size: 8589934592
2019-12-12 17:06:47.400406: E tensorflow/stream_executor/cuda/cuda_driver.cc:890] failed to alloc 8589934592 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2019-12-12 17:06:47.406481: W .\tensorflow/core/common_runtime/gpu/gpu_host_allocator.h:44] could not allocate pinned host memory of size: 8589934592
2019-12-12 17:06:47.465856: E tensorflow/stream_executor/cuda/cuda_driver.cc:890] failed to alloc 8589934592 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2019-12-12 17:06:47.470446: W .\tensorflow/core/common_runtime/gpu/gpu_host_allocator.h:44] could not allocate pinned host memory of size: 8589934592
epochs设为100都会出错,设为1不会,但这显然不能设为1来使用啊
输入图片是1080p的,dataset.txt列表中有2164图片路径
config的batch_size已设为1怎么还报out of memory
按文档的说明,batch_size设小可以减小内存使用的啊,而且模型实际使用的时候是需要batch_size=1的, onnx导出的batch_size和运行rknn.config时如果不匹配输出会报错。
rknn 1.2.1 windows
|
|