aistudio@jupyter-64630-3486734:~$ paddlejsconverter --modelPath=work/code/output/inference_model_picodet_esnet_l/inference_model/model.pdmodel --paramPath=work/code/output/inference_model_picodet_esnet_l/inference_model/model.pdiparams --outputDir=js_picodet_esnet_l
============Convert Model Args=============
modelPath: work/code/output/inference_model_picodet_esnet_l/inference_model/model.pdmodel
paramPath: work/code/output/inference_model_picodet_esnet_l/inference_model/model.pdiparams
outputDir: js_picodet_esnet_l
enableOptimizeModel: 1
enableLogModelInfo: 0
sliceDataSize:4096
Starting...
Optimizing model...
python paddlelite version: 2.7.1
WARNING: Logging before InitGoogleLogging() is written to STDERR
E0216 14:54:28.724778 9078 opt_base.cc:448] Error: This model is not supported, because 10 ops are not supported on 'arm'. These unsupported ops are: 'flatten_contiguous_range, lod_array_length, matmul_v2, meshgrid, multiclass_nms3, nearest_interp_v2, select_input, strided_slice, tensor_array_to_tensor, top_k_v2'.
Optimizing model failed.
Converting model...
Organizing model operators info...
A fetal error occured. Failed to convert model.
Traceback (most recent call last):
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/convertModel.py", line 535, in main
convertToPaddleJSModel(modelDir, modelName, paramsName, outputDir)
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/convertModel.py", line 451, in convertToPaddleJSModel
organizeModelOpInfo()
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/convertModel.py", line 331, in organizeModelOpInfo
jsonDumpsIndentStr = json.dumps(opInfo, indent=2)
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/json/init.py", line 238, in dumps
**kw).encode(obj)
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/json/encoder.py", line 201, in encode
chunks = list(chunks)
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/json/encoder.py", line 431, in _iterencode
yield from _iterencode_dict(o, _current_indent_level)
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/json/encoder.py", line 405, in _iterencode_dict
yield from chunks
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/json/encoder.py", line 405, in _iterencode_dict
yield from chunks
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/json/encoder.py", line 438, in _iterencode
o = _default(o)
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/json/encoder.py", line 179, in default
raise TypeError(f'Object of type {o.class.name} '
TypeError: Object of type BlockDesc is not JSON serializable
描述问题
使用 paddlejsconverter 对 paddlex 中的 PicoDet 模型(已转换为 inference)转换时报错
TypeError: Object of type BlockDesc is not JSON serializable
PicoDet 数据集是钢筋计数项目
Optimizing model failed.
Converting model... Organizing model operators info... A fetal error occured. Failed to convert model. Traceback (most recent call last): File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/convertModel.py", line 535, in main convertToPaddleJSModel(modelDir, modelName, paramsName, outputDir) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/convertModel.py", line 451, in convertToPaddleJSModel organizeModelOpInfo() File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/convertModel.py", line 331, in organizeModelOpInfo jsonDumpsIndentStr = json.dumps(opInfo, indent=2) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/json/init.py", line 238, in dumps **kw).encode(obj) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/json/encoder.py", line 201, in encode chunks = list(chunks) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/json/encoder.py", line 431, in _iterencode yield from _iterencode_dict(o, _current_indent_level) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/json/encoder.py", line 405, in _iterencode_dict yield from chunks File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/json/encoder.py", line 405, in _iterencode_dict yield from chunks File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/json/encoder.py", line 438, in _iterencode o = _default(o) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/json/encoder.py", line 179, in default raise TypeError(f'Object of type {o.class.name} ' TypeError: Object of type BlockDesc is not JSON serializable
============ALL DONE============