wiseodd / controlled-text-generation

Reproducing Hu, et. al., ICML 2017's "Toward Controlled Generation of Text"
BSD 3-Clause "New" or "Revised" License
242 stars 63 forks source link

TypeError: multinomial() missing 1 required positional arguments: "num_samples" #22

Open ZiwenZhuang opened 6 years ago

ZiwenZhuang commented 6 years ago

There is a small problem with the model.py file. Python reported an error when it goes to line 297, where there is a missing argument for the multinomial function.

cimeister commented 5 years ago

Looks like the default num_samples argument in older versions of pytorch was 1: [https://github.com/pytorch/pytorch/issues/2546] I'm guessing that's the case here since no value was explicitly set. You should just be able to add the argument to the multinomial function to get rid of the error

RaOne24 commented 4 years ago

multinomial() missing 1 required positional arguments: "num_samples" how to solve the issue

RaOne24 commented 4 years ago

while running the AI Car program

alexDS12 commented 4 years ago

multinomial() missing 1 required positional arguments: "num_samples" how to solve the issue

you can pass num_samples=1 as parameter, hopefully it will work fine.