You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am use this code to export the pre-model,but it fail
net = gcv.model_zoo.get_model('psp_resnet101_ade', pretrained=True)
export_block('psp_resnet101_ade', net,data_shape=(224, 224, 3), preprocess=True, layout='HWC')
Traceback (most recent call last):
File "I:/Python_project/MachineLearninginAction/exportModel.py", line 6, in
export_block('psp_resnet101_ade', net,data_shape=(224, 224, 3), preprocess=None, layout='HWC')
File "C:\Users\Sumo\AppData\Roaming\Python\Python35\site-packages\gluoncv\utils\export_helper.py", line 109, in export_block
wrapper_block(x)
File "C:\Users\Sumo\AppData\Local\Programs\Python\Python35\lib\site-packages\mxnet\gluon\block.py", line 542, in call
out = self.forward(*args)
File "C:\Users\Sumo\AppData\Local\Programs\Python\Python35\lib\site-packages\mxnet\gluon\block.py", line 909, in forward
return self._call_cached_op(x, *args)
File "C:\Users\Sumo\AppData\Local\Programs\Python\Python35\lib\site-packages\mxnet\gluon\block.py", line 799, in _call_cached_op
self._build_cache(*args)
File "C:\Users\Sumo\AppData\Local\Programs\Python\Python35\lib\site-packages\mxnet\gluon\block.py", line 751, in _build_cache
data, out = self._get_graph(*args)
File "C:\Users\Sumo\AppData\Local\Programs\Python\Python35\lib\site-packages\mxnet\gluon\block.py", line 743, in _get_graph
out = self.hybrid_forward(symbol, *grouped_inputs, **params) # pylint: disable=no-value-for-parameter
File "C:\Users\Sumo\AppData\Roaming\Python\Python35\site-packages\gluoncv\model_zoo\pspnet.py", line 53, in hybrid_forward
x = self.head(c4)
File "C:\Users\Sumo\AppData\Local\Programs\Python\Python35\lib\site-packages\mxnet\gluon\block.py", line 542, in call
out = self.forward(*args)
File "C:\Users\Sumo\AppData\Local\Programs\Python\Python35\lib\site-packages\mxnet\gluon\block.py", line 926, in forward
return self.hybrid_forward(symbol, x, *args, **params)
File "C:\Users\Sumo\AppData\Roaming\Python\Python35\site-packages\gluoncv\model_zoo\pspnet.py", line 115, in hybrid_forward
x = self.psp(x)
File "C:\Users\Sumo\AppData\Local\Programs\Python\Python35\lib\site-packages\mxnet\gluon\block.py", line 542, in call
out = self.forward(*args)
File "C:\Users\Sumo\AppData\Local\Programs\Python\Python35\lib\site-packages\mxnet\gluon\block.py", line 926, in forward
return self.hybrid_forward(symbol, x, *args, **params)
File "C:\Users\Sumo\AppData\Roaming\Python\Python35\site-packages\gluoncv\model_zoo\pspnet.py", line 91, in hybrid_forward
_, _, h, w = x.shape
AttributeError: 'Symbol' object has no attribute 'shape'
The text was updated successfully, but these errors were encountered:
I identified several segmentation models are not hybridizable now, since the models use shape inside the graph. For now only FCN models can be exported without issue.
The workaround for PSP and DeepLab models are to remove the line:
I am use this code to export the pre-model,but it fail
net = gcv.model_zoo.get_model('psp_resnet101_ade', pretrained=True)
export_block('psp_resnet101_ade', net,data_shape=(224, 224, 3), preprocess=True, layout='HWC')
Traceback (most recent call last):
File "I:/Python_project/MachineLearninginAction/exportModel.py", line 6, in
export_block('psp_resnet101_ade', net,data_shape=(224, 224, 3), preprocess=None, layout='HWC')
File "C:\Users\Sumo\AppData\Roaming\Python\Python35\site-packages\gluoncv\utils\export_helper.py", line 109, in export_block
wrapper_block(x)
File "C:\Users\Sumo\AppData\Local\Programs\Python\Python35\lib\site-packages\mxnet\gluon\block.py", line 542, in call
out = self.forward(*args)
File "C:\Users\Sumo\AppData\Local\Programs\Python\Python35\lib\site-packages\mxnet\gluon\block.py", line 909, in forward
return self._call_cached_op(x, *args)
File "C:\Users\Sumo\AppData\Local\Programs\Python\Python35\lib\site-packages\mxnet\gluon\block.py", line 799, in _call_cached_op
self._build_cache(*args)
File "C:\Users\Sumo\AppData\Local\Programs\Python\Python35\lib\site-packages\mxnet\gluon\block.py", line 751, in _build_cache
data, out = self._get_graph(*args)
File "C:\Users\Sumo\AppData\Local\Programs\Python\Python35\lib\site-packages\mxnet\gluon\block.py", line 743, in _get_graph
out = self.hybrid_forward(symbol, *grouped_inputs, **params) # pylint: disable=no-value-for-parameter
File "C:\Users\Sumo\AppData\Roaming\Python\Python35\site-packages\gluoncv\model_zoo\pspnet.py", line 53, in hybrid_forward
x = self.head(c4)
File "C:\Users\Sumo\AppData\Local\Programs\Python\Python35\lib\site-packages\mxnet\gluon\block.py", line 542, in call
out = self.forward(*args)
File "C:\Users\Sumo\AppData\Local\Programs\Python\Python35\lib\site-packages\mxnet\gluon\block.py", line 926, in forward
return self.hybrid_forward(symbol, x, *args, **params)
File "C:\Users\Sumo\AppData\Roaming\Python\Python35\site-packages\gluoncv\model_zoo\pspnet.py", line 115, in hybrid_forward
x = self.psp(x)
File "C:\Users\Sumo\AppData\Local\Programs\Python\Python35\lib\site-packages\mxnet\gluon\block.py", line 542, in call
out = self.forward(*args)
File "C:\Users\Sumo\AppData\Local\Programs\Python\Python35\lib\site-packages\mxnet\gluon\block.py", line 926, in forward
return self.hybrid_forward(symbol, x, *args, **params)
File "C:\Users\Sumo\AppData\Roaming\Python\Python35\site-packages\gluoncv\model_zoo\pspnet.py", line 91, in hybrid_forward
_, _, h, w = x.shape
AttributeError: 'Symbol' object has no attribute 'shape'
The text was updated successfully, but these errors were encountered: