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

YoutubeDNN example run failed #70

Open
tom729 opened this issue Mar 15, 2022 · 0 comments
Open

YoutubeDNN example run failed #70

tom729 opened this issue Mar 15, 2022 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@tom729
Copy link

tom729 commented Mar 15, 2022

output:
Input In [12], in
77 if tf.version >= '2.0.0':
78 tf.compat.v1.disable_eager_execution()
---> 82 model = YoutubeDNN(user_feature_columns, item_feature_columns, num_sampled=5, user_dnn_hidden_units=(64, embedding_dim))
83 #model = MIND(user_feature_columns,item_feature_columns,dynamic_k=False,p=1,k_max=2,num_sampled=5,user_dnn_hidden_units=(64, embedding_dim))
85 model.compile(optimizer="adam", loss=sampledsoftmaxloss) # "binary_crossentropy")

File ~/miniforge3/lib/python3.9/site-packages/deepmatch/models/youtubednn.py:56, in YoutubeDNN(user_feature_columns, item_feature_columns, num_sampled, user_dnn_hidden_units, dnn_activation, dnn_use_bn, l2_reg_dnn, l2_reg_embedding, dnn_dropout, output_activation, seed)
54 item_features = build_input_features(item_feature_columns)
55 item_inputs_list = list(item_features.values())
---> 56 user_dnn_out = DNN(user_dnn_hidden_units, dnn_activation, l2_reg_dnn, dnn_dropout,
57 dnn_use_bn, output_activation=output_activation, seed=seed)(user_dnn_input)
59 item_index = EmbeddingIndex(list(range(item_vocabulary_size)))(item_features[item_feature_name])
61 item_embedding_matrix = embedding_matrix_dict[
62 item_feature_name]

File ~/miniforge3/lib/python3.9/site-packages/tensorflow/python/keras/engine/base_layer_v1.py:784, in Layer.call(self, *args, **kwargs)
781 try:
782 with autocast_variable.enable_auto_cast_variables(
783 self._compute_dtype_object):
--> 784 outputs = call_fn(cast_inputs, *args, **kwargs)
786 except errors.OperatorNotAllowedInGraphError as e:
787 raise TypeError('You are attempting to use Python control '
788 'flow in a layer that was not declared to be '
789 'dynamic. Pass dynamic=True to the class '
790 'constructor.\nEncountered error:\n"""\n' +
791 str(e) + '\n"""')

File ~/miniforge3/lib/python3.9/site-packages/tensorflow/python/autograph/impl/api.py:692, in convert..decorator..wrapper(*args, **kwargs)
690 except Exception as e: # pylint:disable=broad-except
691 if hasattr(e, 'ag_error_metadata'):
--> 692 raise e.ag_error_metadata.to_exception(e)
693 else:
694 raise

FailedPreconditionError: in user code:

File "/Users/tangzhenhua/miniforge3/lib/python3.9/site-packages/deepctr/layers/core.py", line 190, in call  *
    fc = self.activation_layers[i](fc, training=training)
File "/Users/tangzhenhua/miniforge3/lib/python3.9/site-packages/keras/engine/base_layer_v1.py", line 732, in __call__  **
    base_layer_utils.create_keras_history(inputs)
File "/Users/tangzhenhua/miniforge3/lib/python3.9/site-packages/keras/engine/base_layer_utils.py", line 175, in create_keras_history
    _, created_layers = _create_keras_history_helper(tensors, set(), [])
File "/Users/tangzhenhua/miniforge3/lib/python3.9/site-packages/keras/engine/base_layer_utils.py", line 251, in _create_keras_history_helper
    constants[i] = backend.function([], op_input)([])
File "/Users/tangzhenhua/miniforge3/lib/python3.9/site-packages/keras/backend.py", line 4275, in __call__
    fetched = self._callable_fn(*array_vals,

FailedPreconditionError: 2 root error(s) found.
  (0) FAILED_PRECONDITION: Could not find variable dnn_4/bias0. This could mean that the variable has been deleted. In TF1, it can also mean the variable is uninitialized. Debug info: container=localhost, status error message=Container localhost does not exist. (Could not find resource: localhost/dnn_4/bias0)
	 [[{{node dnn_4/BiasAdd/ReadVariableOp}}]]
	 [[dnn_4/BiasAdd/ReadVariableOp/_9]]
  (1) FAILED_PRECONDITION: Could not find variable dnn_4/bias0. This could mean that the variable has been deleted. In TF1, it can also mean the variable is uninitialized. Debug info: container=localhost, status error message=Container localhost does not exist. (Could not find resource: localhost/dnn_4/bias0)
	 [[{{node dnn_4/BiasAdd/ReadVariableOp}}]]
0 successful operations.
0 derived errors ignored.

Operating environment(运行环境):

  • python version 3.9
  • tensorflow version 2.8
  • deepmatch version 0.2.0
  • OS: mac Monterey 12.1
  • CPU: M1 pro
@shenweichen shenweichen added the help wanted Extra attention is needed label Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants