8000 NameError: name 'model' is not defined · Issue #2773 · shap/shap · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
< 8000 div class="d-flex flex-column flex-md-row flex-items-start flex-md-items-center">

NameError: name 'model' is not defined #2773

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

Closed
AshishDave123 opened this issue Nov 19, 2022 · 1 comment
Closed

NameError: name 'model' is not defined #2773

AshishDave123 opened this issue Nov 19, 2022 · 1 comment

Comments

@AshishDave123
Copy link

Please help anyone below is the issue?

def predict_review(text): #1. predict_review
encoded_text = encoder.encode(text)
encoded_text = tf.cast(encoded_text, tf.float32)
prediction = model.predict(tf.expand_dims(encoded_text, 1))
return prediction

review = ('Good movie') #1. predict_review
pred = predict_review(review)
pred, pred.shape

Error:


NameError Traceback (most recent call last)
in
1 review = ('Good movie') #1. predict_review
----> 2 pred = predict_review(review)
3 pred, pred.shape

in predict_review(text)
2 encoded_text = encoder.encode(text)
3 encoded_text = tf.cast(encoded_text, tf.float32)
----> 4 prediction = model.predict(tf.expand_dims(encoded_text, 1))
5 return prediction

NameError: name 'model' is not defined

@dsgibbons
Copy link
Collaborator

This is not a shap issue. You are attempting to call a variable named model that hasn't been defined.

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
0