Ian8888 opened a new issue #14848: Create Resnet152 training using 
vision.get_model API
URL: https://github.com/apache/incubator-mxnet/issues/14848
 
 
   I want to create training about resnet152, and I use vision.get_model api.
   The problem is can't using mod.Module api
   My code is 
   ```
   import mxnet as mx
   from mxnet.gluon.model_zoo import vision
   
   resnet152 = vision.get_model('resnet152_v2', classes =2)
   
   mod = mx.mod.Module(symbol=resnet152,context=mx.gpu())
   mod.bind(for_training=False,data_shapes=[('data', (batch_size, 3, 128, 
128))])
   mod.set_params(arg_params,aux_params)
   ```
   the error is
   
   > AttributeError                            Traceback (most recent call last)
   > <ipython-input-41-30cb0076f42f> in <module>()
   >      13 test_dataiter = mx.io.ImageRecordIter(path_imgrec = 
Testing_Rec_path, scale = 1./255, rand_crop = True, rand_mirror = True, 
data_shape = (Training_IMG_channel, Training_IMG_size, Training_IMG_size), 
batch_size = batch_size, preprocess_threads = 14)
   >      14 
   > ---> 15 mod = mx.mod.Module(symbol=resnet152,context=mx.gpu())
   >      16 mod.bind(for_training=False,data_shapes=[('data', (batch_size, 3, 
128, 128))])
   >      17 mod.set_params(arg_params,aux_params)
   > 
   > 
/home/mxnetcv309ii/.local/lib/python2.7/site-packages/mxnet/module/module.pyc 
in __init__(self, symbol, data_names, label_names, logger, context, 
work_load_list, fixed_param_names, state_names, group2ctxs, compression_params)
   >      93         fixed_param_names = list(fixed_param_names) if 
fixed_param_names is not None else []
   >      94 
   > ---> 95         _check_input_names(symbol, data_names, "data", True)
   >      96         _check_input_names(symbol, label_names, "label", False)
   >      97         _check_input_names(symbol, state_names, "state", True)
   > 
   > 
/home/mxnetcv309ii/.local/lib/python2.7/site-packages/mxnet/module/base_module.pyc
 in _check_input_names(symbol, names, typename, throw)
   >      38 def _check_input_names(symbol, names, typename, throw):
   >      39     """Check that all input names are in symbol's arguments."""
   > ---> 40     args = symbol.list_arguments()
   >      41     for name in names:
   >      42         if name in args:
   > 
   > AttributeError: 'ResNetV2' object has no attribute 'list_arguments'
   
   How can I fix the problem?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to