- # 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')
复制代码
jefferyzhang 发表于 2019-12-13 08:43
CUDA_ERROR_OUT_OF_MEMORY 跟混合量化啥关系。。。
- 2019-12-13 15:53:14.846719: W .\tensorflow/core/common_runtime/gpu/gpu_host_allocator.h:44] could not allocate pinned host memory of size: 8589934592
- I iterations: 196
- 2019-12-13 15:53:14.854817: 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-13 15:53:14.859445: W .\tensorflow/core/common_runtime/gpu/gpu_host_allocator.h:44] could not allocate pinned host memory of size: 8589934592
复制代码
jefferyzhang 发表于 2019-12-16 08:21
rknn不会去申请GPU的显存。
我们用的是内存。。。
xsky 发表于 2019-12-16 10:31
在win10上用混合量化也是一样的流程不会用GPU么? 这是在win10 上用 toolkit 1.2.1 ...
jefferyzhang 发表于 2019-12-16 10:38
你想的有点多。
量化和转换都是纯cpu用c写的代码,c写出来代码要能自动用到GPU,还跑了CUDA,那 ...
欢迎光临 Toybrick (https://t.rock-chips.com/) | Powered by Discuz! X3.3 |