Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with model.py on python 3 #22

Open
3079 opened this issue May 10, 2018 · 1 comment
Open

problem with model.py on python 3 #22

3079 opened this issue May 10, 2018 · 1 comment

Comments

@3079
Copy link

3079 commented May 10, 2018

So it didn't work at all on python 2 so i changed the code a little to make sure it runs on python 3 and after fixing some issues the train mode worked, but when i tried to generate lyrics i ran into a problem
File "model3f.py", line 219, in calculate_score
score = 1.0 - (abs((float(desired_syllables) - float(syllables))) + abs((float(desired_rhyme) - float(rhyme)))) - penalty
TypeError: float() argument must be a string or a number, not 'NoneType'

i guess the issue is in rhyme function, it runs into an exception and returns None, not float needed and that causes the problem, but i dont know how to fix it.
Any suggestions? here are model files i use (t is for train and f is for generation mode)
I also changed artist name and all "rap" words to "lyrics" , i guess it doesen't affect anything
neural network.zip

@zzhong8
Copy link

zzhong8 commented Nov 5, 2018

Your error is due to the line below:

rhymeslist = [x.encode('UTF8') for x in rhymeslist]

There are two instances of this line in the code and you need to comment out or delete both instances in order for the program to run in Python 3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants