graykode / xlnet-Pytorch

Simple XLNet implementation with Pytorch Wrapper
https://arxiv.org/pdf/1906.08237.pdf
Apache License 2.0
577 stars 107 forks source link

TypeError:can't convert np.ndarray of type numpy.bool_ #6

Open menggehe opened 5 years ago

menggehe commented 5 years ago

Traceback (most recent call last): File "main.py", line 89, in num_predict=args.num_predict) File "/home/hemengge/xlnet-pytorch/data_utils.py", line 335, in make_permute is_masked = torch.Tensor(feature.pop("is_masked"))

TypeError: can't convert np.ndarray of type numpy.bool_. The only supported types are: double, float, float16, int64, int32, and uint8

LorraineLo4 commented 5 years ago

Having the same issue.

xingchensong commented 5 years ago

is_masked = torch.ByteTensor(feature.pop("is_masked").copy().astype(np.uint8)) @menggehe