You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2017/11/16 07:48:11 UTC

[GitHub] GSanchis commented on issue #8669: module.Module and CSVIter

GSanchis commented on issue #8669: module.Module and CSVIter
URL: https://github.com/apache/incubator-mxnet/issues/8669#issuecomment-344842083
 
 
   Well, I should have said I [think I] also tried that :)
   
   In fact, I just tried two options: `data_names` and `data_name` (since in your message you actually mention both), but no luck either:
   
   ```
   model = mx.module.Module(context=mx.cpu(0), data_names=['user', 'movie'], symbol=y_pred)
   CSVIter = mx.io.CSVIter(data_csv=f1, data_shape=(2,), label_csv=f2, label_shape=(1,), batch_size=1000, data_name=['user','movie'])
   model.fit(CSVIter, num_epoch=5, optimizer='adam', optimizer_params=(('learning_rate', 0.001),))
   ``` 
   returns
   ```
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File "/home/german/anaconda3/lib/python3.6/site-packages/mxnet/module/base_module.py", line 460, in fit
       for_training=True, force_rebind=force_rebind)
     File "/home/german/anaconda3/lib/python3.6/site-packages/mxnet/module/module.py", line 400, in bind
       self.data_names, self.label_names, data_shapes, label_shapes)
     File "/home/german/anaconda3/lib/python3.6/site-packages/mxnet/module/base_module.py", line 71, in _parse_data_desc
       _check_names_match(data_names, data_shapes, 'data', True)
     File "/home/german/anaconda3/lib/python3.6/site-packages/mxnet/module/base_module.py", line 63, in _check_names_match
       raise ValueError(msg)
   ValueError: Data provided by data_shapes don't match names specified by data_names ([DataDesc[['user', 'movie'],(1000, 2),<class 'numpy.float32'>,NCHW]] vs. ['user', 'movie'])
   ```
   
   Whereas `data_names` (as the error message seems to indicate), returns:
   ```
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File "/home/german/anaconda3/lib/python3.6/site-packages/mxnet/module/base_module.py", line 460, in fit
       for_training=True, force_rebind=force_rebind)
     File "/home/german/anaconda3/lib/python3.6/site-packages/mxnet/module/module.py", line 400, in bind
       self.data_names, self.label_names, data_shapes, label_shapes)
     File "/home/german/anaconda3/lib/python3.6/site-packages/mxnet/module/base_module.py", line 71, in _parse_data_desc
       _check_names_match(data_names, data_shapes, 'data', True)
     File "/home/german/anaconda3/lib/python3.6/site-packages/mxnet/module/base_module.py", line 63, in _check_names_match
       raise ValueError(msg)
   ValueError: Data provided by data_shapes don't match names specified by data_names ([DataDesc[data,(1000, 2),<class 'numpy.float32'>,NCHW]] vs. ['user', 'movie'])
   ```
   Which is the same error as above... I.e., the correct parameter seems to be `data_name`, but there's still something missing.
   
   Thanks for your help, Eric!!

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


With regards,
Apache Git Services