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

An error occurred in the _configure_kernel_centers function in the LSDDOnlineDrift class #800

Open
KevinRyu opened this issue May 26, 2023 · 3 comments
Labels
Type: Docs Anything related to documentation Type: Question User questions

Comments

@KevinRyu
Copy link

Hi,

When I run drift detection with LSDDOnlineDrift class, the following error occurred.

[Error Message]
InvalidArgumentError: cannot compute AddV2 as input #1(zero-based) was expected to be a double tensor but is a float tensor [Op:AddV2]

[Code]
perturbation = tf.random.normal(self.kernel_centers.shape, mean=0, stddev=1e-6)
self.kernel_centers = self.kernel_centers + perturbation

So, I tried to change the datatype of each operand and checked errors.
First, I changed the type of perturbation from tf.float32 to tf.float64 with tf.cast. But I got an OOM error.
And then, It was solved by changing the type of self.kernel_centers from tf.float64 to tf.float32.

I want to know this modification has no problem.
What do you think about this case?

@jklaise
Copy link
Contributor

jklaise commented May 26, 2023

Can you show us the full code and the full stack-trace? Generally with tensorflow and torch frameworks, all tensors should be float32 by default, so I'm curious how the "was expected to be a double tensor" can happen.

@jklaise jklaise added the Type: Question User questions label May 26, 2023
@jklaise
Copy link
Contributor

jklaise commented May 26, 2023

Note that in our example notebook the data is cast to np.float32 before doing anything else (cell 4), this ensures that any further operations produce float32 tensors.

Is this something we need to document better across the library? @ojcobb @ascillitoe

@KevinRyu
Copy link
Author

KevinRyu commented May 26, 2023 via email

@jklaise jklaise added the Type: Docs Anything related to documentation label May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Docs Anything related to documentation Type: Question User questions
Projects
None yet
Development

No branches or pull requests

2 participants