Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error : Wrong number or type of arguments for overloaded function 'IVector_create' #2422

Closed
jeromeJT opened this issue Jun 8, 2017 · 3 comments
Assignees

Comments

@jeromeJT
Copy link

jeromeJT commented Jun 8, 2017

错误信息:

Traceback (most recent call last):
  File "train.py", line 81, in <module>
    num_passes=2
  File "/home/map/taotao/paddlev2/python27/lib/python2.7/site-packages/paddle/v2/trainer.py", line 150, in train
    in_args = feeder(data_batch)
  File "/home/map/taotao/paddlev2/python27/lib/python2.7/site-packages/py_paddle/dataprovider_converter.py", line 249, in __call__
    return self.convert(dat, argument)
  File "/home/map/taotao/paddlev2/python27/lib/python2.7/site-packages/paddle/v2/data_feeder.py", line 134, in convert
    return DataProviderConverter.convert(self, reorder_data(dat), argument)
  File "/home/map/taotao/paddlev2/python27/lib/python2.7/site-packages/py_paddle/dataprovider_converter.py", line 244, in convert
    scanner.finish_scan(argument)
  File "/home/map/taotao/paddlev2/python27/lib/python2.7/site-packages/py_paddle/dataprovider_converter.py", line 178, in finish_scan
    ids = swig_paddle.IVector.create(self.__ids__, self.data_in_gpu)
  File "/home/map/taotao/paddlev2/python27/lib/python2.7/site-packages/py_paddle/swig_paddle.py", line 881, in create
    return _swig_paddle.IVector_create(*args)
NotImplementedError: Wrong number or type of arguments for overloaded function 'IVector_create'.
  Possible C/C++ prototypes are:
    IVector::create(std::vector< int,std::allocator< int > > const &,bool)
    IVector::create(std::vector< int,std::allocator< int > > const &)

调用方式见附件train.py.txt
train.py.txt

@QiJune QiJune self-assigned this Jun 8, 2017
@lcy-seso
Copy link
Contributor

lcy-seso commented Jun 8, 2017

从附件看,lstm 的输出是一个序列,配置中没有 pooling 层,label 这个 data_layer 的 type 不对,应该是 integer_value_sequence

@lcy-seso
Copy link
Contributor

lcy-seso commented Jun 8, 2017

You can take this as an example on how to provide your own data to PaddlePaddle on classifying sequence inputs: https://github.com/PaddlePaddle/models/tree/develop/text_classification#%E8%87%AA%E5%AE%9A%E4%B9%89%E6%95%B0%E6%8D%AE

@lcy-seso
Copy link
Contributor

lcy-seso commented Jun 8, 2017

The following line in the attachment:

feeding = {'status': 0, 'label': 0} 

has a bug. It should be like this:

feeding = {'status': 0, 'label': 1}

@lcy-seso lcy-seso changed the title 调用train()函数报错 Error : Wrong number or type of arguments for overloaded function 'IVector_create' Jun 8, 2017
@lcy-seso lcy-seso closed this as completed Jun 8, 2017
heavengate added a commit to heavengate/Paddle that referenced this issue Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants