Closed songhc8 closed 2 years ago
solved.
by providing calib dataset
for example:
python3 ./tools/deploy.py /projs/mmdeploy/configs/mmseg/segmentation_tensorrt-int8_static-512x512.py /projs/mmsegmentation/configs/fastscnn/fast_scnn_lr0.12_8x4_160k_cityscapes.py /projs/mmsegmentation/configs/fastscnn/fast_scnn_lr0.12_8x4_160k_cityscapes_20210630_164853-0cec9937.pth /projs/mmsegmentation/demo/demo.png --work-dir /projs/mmdeploy/song/ --device cuda:0 --quant-image-dir /projs/images --quant --calib-dataset-cfg /projs/mmdeploy/song/ade20k.py
--calib-dataset-cfg points to ade20k.py in which ade20dataset is defined.
solved. by providing calib dataset for example:
python3 ./tools/deploy.py /projs/mmdeploy/configs/mmseg/segmentation_tensorrt-int8_static-512x512.py /projs/mmsegmentation/configs/fastscnn/fast_scnn_lr0.12_8x4_160k_cityscapes.py /projs/mmsegmentation/configs/fastscnn/fast_scnn_lr0.12_8x4_160k_cityscapes_20210630_164853-0cec9937.pth /projs/mmsegmentation/demo/demo.png --work-dir /projs/mmdeploy/song/ --device cuda:0 --quant-image-dir /projs/images --quant --calib-dataset-cfg /projs/mmdeploy/song/ade20k.py
--calib-dataset-cfg points to ade20k.py in which ade20dataset is defined.
Hi, I have the same problem. I want to ask what the --calib-dataset-cfg is. How do I write this .py?
solved. by providing calib dataset for example:
python3 ./tools/deploy.py /projs/mmdeploy/configs/mmseg/segmentation_tensorrt-int8_static-512x512.py /projs/mmsegmentation/configs/fastscnn/fast_scnn_lr0.12_8x4_160k_cityscapes.py /projs/mmsegmentation/configs/fastscnn/fast_scnn_lr0.12_8x4_160k_cityscapes_20210630_164853-0cec9937.pth /projs/mmsegmentation/demo/demo.png --work-dir /projs/mmdeploy/song/ --device cuda:0 --quant-image-dir /projs/images --quant --calib-dataset-cfg /projs/mmdeploy/song/ade20k.py
--calib-dataset-cfg points to ade20k.py in which ade20dataset is defined. And, when I use the val dataset in model config, the error as follows happened. I don't know the reason. The int8 model is set for mmrotate task.
0%| | 0/40 [00:00<?, ?it/s][2022-09-14 22:52:07.137] [mmdeploy] [info] [model.cpp:95] Register 'DirectoryModel'
0%| | 0/40 [00:01<?, ?it/s]
Process Process-3:
Traceback (most recent call last):
File "/home/zjq/anaconda3/envs/open-mmlab/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
self.run()
File "/home/zjq/anaconda3/envs/open-mmlab/lib/python3.7/multiprocessing/process.py", line 99, in run
self._target(*self._args, self._kwargs)
File "/home/zjq/open-mmlab/MMDeploy/mmdeploy/apis/core/pipeline_manager.py", line 107, in call
ret = func(*args, *kwargs)
File "/home/zjq/open-mmlab/MMDeploy/mmdeploy/apis/calibration.py", line 82, in create_calib_input_data
device=device)
File "/home/zjq/open-mmlab/MMDeploy/mmdeploy/apis/core/pipeline_manager.py", line 356, in _wrap
return self.call_function(funcname, args, kwargs)
File "/home/zjq/open-mmlab/MMDeploy/mmdeploy/apis/core/pipeline_manager.py", line 326, in call_function
return self.call_function_local(func_name, *args, kwargs)
File "/home/zjq/open-mmlab/MMDeploy/mmdeploy/apis/core/pipeline_manager.py", line 275, in call_function_local
return pipe_caller(*args, *kwargs)
File "/home/zjq/open-mmlab/MMDeploy/mmdeploy/apis/core/pipeline_manager.py", line 107, in call
ret = func(args, kwargs)
File "/home/zjq/open-mmlab/MMDeploy/mmdeploy/apis/utils/calibration.py", line 67, in create_calib_input_data
input_ndarray = input_tensor.detach().cpu().numpy()
AttributeError: 'DataContainer' object has no attribute 'detach'
2022-09-14 22:52:08,470 - mmdeploy - ERROR - mmdeploy.apis.calibration.create_calib_input_data
with Call id: 1 failed. exit.
hi,
Thanks for your time. I am trying to deploy the model in Xavier nx platform. I have built the environment and tested the deploy.py without quantization, it works fine.
But when i tried to deploy the model with quantization like this:
python3 ./tools/deploy.py /projs/mmdeploy/configs/mmseg/segmentation_tensorrt-int8_static-512x512.py /projs/mmsegmentation/configs/fastscnn/fast_scnn_lr0.12_8x4_160k_cityscapes.py /projs/mmsegmentation/configs/fastscnn/fast_scnn_lr0.12_8x4_160k_cityscapes_20210630_164853-0cec9937.pth /projs/mmsegmentation/demo/demo.png --work-dir /projs/mmdeploy/song/ --device cuda:0 --quant-image-dir /projs/images --quant
It's failed and throw the error message like that: [Errno 2] No such file or directory: 'data/cityscapes/leftImg8bit/val'
how can I fix this error. I do not have the cityscapes dataset.
Chinese version.
你好,我在尝试Xavier NX上部署mmdeploy和mmseg。 环境搭建完成,不进行int量化时,deploy.py可以正常执行完。当我用以下代码进行int8的部署的时候会提示错误。
python3 ./tools/deploy.py /projs/mmdeploy/configs/mmseg/segmentation_tensorrt-int8_static-512x512.py /projs/mmsegmentation/configs/fastscnn/fast_scnn_lr0.12_8x4_160k_cityscapes.py /projs/mmsegmentation/configs/fastscnn/fast_scnn_lr0.12_8x4_160k_cityscapes_20210630_164853-0cec9937.pth /projs/mmsegmentation/demo/demo.png --work-dir /projs/mmdeploy/song/ --device cuda:0 --quant-image-dir /projs/images --quant
错误信息如下: [Errno 2] No such file or directory: 'data/cityscapes/leftImg8bit/val'
我想请问下如果我已经提供了quant-image-dir,还需要按照cityscape的格式提供数据吗?是否有别的参数可以控制不使用默认的训练数据做calib