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

Cannot convert a symbolic tf.Tensor (Placeholder_6:0) to a numpy array #1724

Open
yuan743470957 opened this issue Apr 28, 2024 · 2 comments
Open

Comments

@yuan743470957
Copy link

def pde2(x, y):
    dy_x = dde.grad.jacobian(y, x, i=0, j=0)
    dy_t = dde.grad.jacobian(y, x, i=0, j=1)
    dy_xx = dde.grad.hessian(y, x, i=0, j=0)
    y_pred_value = model.predict(x)
    return dy_t + y_pred_value * dy_x - 0.01 / np.pi * dy_xx

NotImplementedError: Cannot convert a symbolic tf.Tensor (Placeholder_6:0) to a numpy array. This error may indicate that you're trying to pass a Tensor to a NumPy call, which is not supported.

@praksharma
Copy link
Contributor

This is the problem.

y_pred_value = model.predict(x)

Can you show me your PDE please?

@yuan743470957
Copy link
Author

yuan743470957 commented May 7, 2024

def pde(x, y):
    dy_x = dde.grad.jacobian(y, x, i=0, j=0)
    dy_t = dde.grad.jacobian(y, x, i=0, j=1)

    dy_xx = dde.grad.hessian(y, x, i=0, j=0)
    return  dy_t + y * dy_x - 0.01 / np.pi * dy_xx

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