optas / latent_3d_points

Auto-encoding & Generating 3D Point-Clouds.
Other
506 stars 109 forks source link

NameError: name 'raw_input' is not defined #31

Open HripsimeS opened 1 year ago

HripsimeS commented 1 year ago

@optas @olkido Hello. I am trying to run the train_single_class_ae.ipynb file and I got the error that 'raw_input' is not defined. Do I need to import it additionally or there was probably an issue with the installations? Hope to hear from you soon!

image

CPSuperstore commented 7 months ago

TL; DR: Change raw_input to input.

Back in Python 2, if you wanted your code to ask for command line input, you could use either the input or raw_input function. If I recall, input would attempt to convert the input to a number or evaluate the expression or something like that, whereas raw_input simply treated the input as a string.

In Python 3, raw_input and input were merged into the same function (input) which takes the value entered as a string and it is up to the developer to evaluate it explicitly.

It looks like you are using Python 3, and it looks like this code base was written in Python 2, so making the change is nessisary.

Just as a side note, there is also a tool called 2 to 3 for migrating code from Python 2 to 3 which should do most of the work for you if there are any other version issues.

Hope this helps!