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

AttributeError: 'Tensor' object has no attribute '_uses_learning_phase' #11

Open
upavloff opened this issue Jun 27, 2019 · 0 comments
Open

Comments

@upavloff
Copy link

upavloff commented Jun 27, 2019

Hello,
I'm trying all your models in order to determine which one fits the most with my acceptation. This is for CTR prediction with Avazu data.
I tried them all I have mistakes in four of them, some of which are probably due to me, the one I understand the least is the following :
<< AttributeError: 'Tensor' object has no attribute '_uses_learning_phase' >>

Here is my code (which is more or less the example code you gave for criteo) :

model = DIN({"sparse": sparse_feature_list,"dense": dense_feature_list},
sparse_feature_name,task='binary')

model.compile("adam", "binary_crossentropy", metrics=['binary_crossentropy'], )

history = model.fit(train_model_input, train[click].values,
batch_size=226, epochs=5, verbose=2, validation_split=0.2, )


Just so you know here is the output of :

print( sparse_feature_list )
[SingleFeat(name='site_id', dimension=1000, hash_flag=True, dtype='string'),
SingleFeat(name='site_domain', dimension=1000, hash_flag=True, dtype='string'),
SingleFeat(name='site_category', dimension=1000, hash_flag=True, dtype='string'),
SingleFeat(name='app_id', dimension=1000, hash_flag=True, dtype='string'),
SingleFeat(name='app_domain', dimension=1000, hash_flag=True, dtype='string'),
SingleFeat(name='app_category', dimension=1000, hash_flag=True, dtype='string'),
SingleFeat(name='device_id', dimension=1000, hash_flag=True, dtype='string'),
SingleFeat(name='device_ip', dimension=1000, hash_flag=True, dtype='string'),
SingleFeat(name='device_model', dimension=1000, hash_flag=True, dtype='string')]
print(dense_feature_list)
[SingleFeat(name='id', dimension=0, hash_flag=False, dtype='float32'),
SingleFeat(name='C1', dimension=0, hash_flag=False, dtype='float32'),
SingleFeat(name='banner_pos', dimension=0, hash_flag=False, dtype='float32'),
SingleFeat(name='device_type', dimension=0, hash_flag=False, dtype='float32'),
SingleFeat(name='device_conn_type', dimension=0, hash_flag=False, dtype='float32'),
SingleFeat(name='C14', dimension=0, hash_flag=False, dtype='float32'),
SingleFeat(name='C15', dimension=0, hash_flag=False, dtype='float32'),
SingleFeat(name='C16', dimension=0, hash_flag=False, dtype='float32'),
SingleFeat(name='C17', dimension=0, hash_flag=False, dtype='float32'),
SingleFeat(name='C18', dimension=0, hash_flag=False, dtype='float32'),
SingleFeat(name='C19', dimension=0, hash_flag=False, dtype='float32'),
SingleFeat(name='C20', dimension=0, hash_flag=False, dtype='float32'),
SingleFeat(name='C21', dimension=0, hash_flag=False, dtype='float32'),
SingleFeat(name='hour', dimension=0, hash_flag=False, dtype='float32'),
SingleFeat(name='weekday', dimension=0, hash_flag=False, dtype='float32')]

If you have any comment on what I might do wrong don't hesitate to tell me !

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

1 participant