'function'对象没有属性'encode'python

问题描述

/usr/local/lib/python3.6/dist-packages/ipykernel_launcher.py:20: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  0%|          | 0/802 [00:00<?,?it/s]
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-63-cd058a3c894f> in <module>()
----> 1 train_x,train_y = load_data(train)
      2 test_x,test_y = load_data(test)

1 frames
<ipython-input-62-a330539f2411> in convert_data(data_df)
      5     indices,targets = [],[]
      6     for i in tqdm(range(len(data_df))):
----> 7         ids,segments = make_input_model.encode(data_df[DATA_COLUMN][i],max_len=SEQ_LEN)
      8         indices.append(ids)
      9         targets.append(data_df[LABEL_COLUMN][i])

AttributeError: 'function' object has no attribute 'encode'

我不知道如何使用我的功能

我只想加载train_x,train_y = load_data(train) 和load_data函数具有my_function.encode()

请帮助我

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...