Tongjilibo / bert4torch

An elegent pytorch implement of transformers
https://bert4torch.readthedocs.io/
MIT License
1.23k stars 153 forks source link

could not broadcast input array from shape (2,13) into shape (2,) #173

Open dengqiqi123 opened 1 month ago

dengqiqi123 commented 1 month ago

python3.8.19 numpy 1.23.0 bert4torch 0.5.1 image builtins.ValueError: could not broadcast input array from shape (2,13) into shape (2,) 降低numpy版本还是不行

Tongjilibo commented 1 month ago

要看你的输入是什么,如果你是代码中指定的类型,应该不会报错,如需要进一步的排查,需要看下你的源代码

dengqiqi123 commented 3 weeks ago

使用的你task_sentiment_classification.py这个代码,输入是 image 列表

Tongjilibo commented 3 weeks ago

看你的输入,感觉你是sequence_padding(tokenizer.encode(text, maxlen=maxlen)), 以下是我的inputs image