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

ValueError: setting an array element with a sequence. #59912

Open
NoteDance opened this issue Mar 6, 2023 · 6 comments
Open

ValueError: setting an array element with a sequence. #59912

NoteDance opened this issue Mar 6, 2023 · 6 comments
Assignees
Labels
comp:ops OPs related issues subtype:windows Windows Build/Installation Issues TF 2.11 Issues related to TF 2.11 type:support Support issues

Comments

@NoteDance
Copy link

NoteDance commented Mar 6, 2023

Click to expand!

Issue Type

Support

Have you reproduced the bug with TF nightly?

No

Source

source

Tensorflow Version

tf 2.11.0

Custom Code

Yes

OS Platform and Distribution

Windows 11

Mobile device

No response

Python version

3.7.16

Bazel version

No response

GCC/Compiler version

No response

CUDA/cuDNN version

No response

GPU model and memory

No response

Current Behaviour?

ValueError: setting an array element with a sequence.

Standalone code to reproduce the issue

import tensorflow as tf
import numpy as np


a=np.ones([64])
b=np.ones([64])


class assign:
    def __init__(self):
        self.c=np.ones([64])
    
    
    def assign(self,d):
        for i in range(len(self.c)):
            self.c[i]=d[i]


def sub(a,b,assign_object):
    d=a-b
    assign_object.assign(d)


@tf.function
def f(a,b,assign_object):
    sub(a,b,assign_object)


assign_object=assign()
f(a,b,assign_object)

Relevant log output

No response

@google-ml-butler google-ml-butler bot added the type:support Support issues label Mar 6, 2023
@gaikwadrahul8 gaikwadrahul8 added TF 2.11 Issues related to TF 2.11 subtype:windows Windows Build/Installation Issues comp:ops OPs related issues labels Mar 8, 2023
@gaikwadrahul8
Copy link
Contributor

Hi, @NoteDancing

Apologize for the delayed response and I was able to replicate the same issue on Google Colab with Tensorflow==2.11 and it's giving me the same error what you're getting, for your reference I have added gist-file and We have to dig more into this issue so we'll update you soon, Meanwhile could you please check this stack-overflow answer which may solve your issue. Thank you!

@gaikwadrahul8 gaikwadrahul8 added the stat:awaiting response Status - Awaiting response from author label Mar 9, 2023
@NoteDance
Copy link
Author

@gaikwadrahul8 Thank you for your answer, I modified the code and have new question.here

@google-ml-butler google-ml-butler bot removed the stat:awaiting response Status - Awaiting response from author label Mar 9, 2023
@gaikwadrahul8
Copy link
Contributor

gaikwadrahul8 commented Mar 17, 2023

Hi, @NoteDancing

Apologize for the delayed response and I would suggest you to please refer our Autograph reference guide and that official documentation has some sections which may help to solve your issue like Better performance with tf.function, Error handling, Limitations, Common AutoGraph errors till then I'll try to replicate same issue from my end and I'll update you soon.Thank you!

@NoteDance
Copy link
Author

@gaikwadrahul8 Thank you for your answer.

@gaikwadrahul8
Copy link
Contributor

Hi, @NoteDancing

You're welcome and Just to confirm, May I know your issue got resolved by following above documentation or still you need help with your issue ? Thank you!

@gaikwadrahul8 gaikwadrahul8 added the stat:awaiting response Status - Awaiting response from author label Mar 23, 2023
@NoteDance
Copy link
Author

@gaikwadrahul8 No, I haven't resolved it yet.Thank you!

@google-ml-butler google-ml-butler bot removed the stat:awaiting response Status - Awaiting response from author label Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:ops OPs related issues subtype:windows Windows Build/Installation Issues TF 2.11 Issues related to TF 2.11 type:support Support issues
Projects
None yet
Development

No branches or pull requests

3 participants