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

sparsefeature,以传入vocabulary_path的方式做hash,报错 #84

Open
LitteleStar opened this issue Jul 13, 2022 · 1 comment
Open

Comments

@LitteleStar
Copy link

当我用vocabulary_path的方式做hash,如下:
VarLenSparseFeat(SparseFeat('short_item', vocabulary_size=100, embedding_dim=8,use_hash=True,vocabulary_path=index,dtype='int32',embeddings_initializer='uniform',
embedding_name='item'), 4,'mean',
length_name="short_sess_length")

就会有报错:
File "/root/python_proj/song_matching/models/utils.py", line 342, in check_model
model.fit(x, y, batch_size=10, epochs=2, validation_split=0.5)
File "/root/anaconda3/envs/tf2/lib/python3.7/site-packages/tensorflow/python/keras/engine/training_v1.py", line 809, in fit
use_multiprocessing=use_multiprocessing)
File "/root/anaconda3/envs/tf2/lib/python3.7/site-packages/tensorflow/python/keras/engine/training_arrays.py", line 666, in fit
steps_name='steps_per_epoch')
File "/root/anaconda3/envs/tf2/lib/python3.7/site-packages/tensorflow/python/keras/engine/training_arrays.py", line 386, in model_iteration
batch_outs = f(ins_batch)
File "/root/anaconda3/envs/tf2/lib/python3.7/site-packages/tensorflow/python/keras/backend.py", line 3825, in call
run_metadata=self.run_metadata)
File "/root/anaconda3/envs/tf2/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1472, in call
run_metadata_ptr)
tensorflow.python.framework.errors_impl.FailedPreconditionError: Table not initialized.
[[{{node hash/hash_table_Lookup/hash_table_Lookup/LookupTableFindV2}}]]

@zhuchenxi
Copy link

同问

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