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

【Question】NotImplementedError: run SDNE in Python3.8, tf2.11.0 #78

Open
YannAdams opened this issue Feb 21, 2023 · 1 comment
Open

Comments

@YannAdams
Copy link

To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
Traceback (most recent call last):
File "d:/pyproject/graph_projects/GraphEmbedding/examples/sdne_wiki.py", line 50, in
model.train(batch_size=1024, epochs=40, verbose=2)
File "D:\anaconda3\envs\emb38\lib\site-packages\ge-0.0.0-py3.8.egg\ge\models\sdne.py", line 126, in train
File "D:\anaconda3\envs\emb38\lib\site-packages\tensorflow\python\keras\engine\training.py", line 1846, in train_on_batch
logs = self.train_function(iterator)
File "D:\anaconda3\envs\emb38\lib\site-packages\tensorflow\python\util\traceback_utils.py", line 153, in error_handler
raise e.with_traceback(filtered_tb) from None
File "C:\Users\57438\AppData\Local\Temp_autograph_generated_file88ea3gk0.py", line 15, in tf__train_function
retval
= ag__.converted_call(ag__.ld(step_function), (ag__.ld(self), ag__.ld(iterator)), None, fscope)
File "C:\Users\57438\AppData\Local\Temp_autograph_generated_file3jc4tox5.py", line 11, in tf__loss_2nd
b
= ag__.converted_call(ag__.ld(np).ones_like, (ag__.ld(y_true),), None, fscope)
File "<array_function internals>", line 200, in ones_like
File "D:\anaconda3\envs\emb38\lib\site-packages\numpy\core\numeric.py", line 281, in ones_like
res = empty_like(a, dtype=dtype, order=order, subok=subok, shape=shape)
File "<array_function internals>", line 200, in empty_like
NotImplementedError: in user code:

File "D:\anaconda3\envs\emb38\lib\site-packages\ge-0.0.0-py3.8.egg\ge\models\sdne.py", line 36, in loss_2nd  *
    b_ = np.ones_like(y_true)
File "<__array_function__ internals>", line 200, in ones_like  **

File "D:\anaconda3\envs\emb38\lib\site-packages\numpy\core\numeric.py", line 281, in ones_like
    res = empty_like(a, dtype=dtype, order=order, subok=subok, shape=shape)
File "<__array_function__ internals>", line 200, in empty_like


NotImplementedError: Cannot convert a symbolic tf.Tensor (IteratorGetNext:2) to a numpy array. This error may indicate that you're trying to pass a Tensor to a NumPy call, which is not supported.   
@sufefffyz
Copy link

Do you solve the problem?I meet the same error

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