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

Noise2Void shape broadcast error during prediction #83

Open
astronerdF opened this issue Mar 20, 2024 · 0 comments
Open

Noise2Void shape broadcast error during prediction #83

astronerdF opened this issue Mar 20, 2024 · 0 comments

Comments

@astronerdF
Copy link

I have followed the 293_denoising_RGB_images_using_deep_learning.ipynb and everything seemed fine except while trying to predict.

This is the error that I get:
`pred = model.predict(img, axes='YXC')


ValueError Traceback (most recent call last)
Cell In[26], line 5
1 # Here we denoise the image (predict)
2 # The parameter 'n_tiles' can be used if images are to big for the GPU memory.
3 # If we do not provide the n_tiles' parameter the system will automatically try to find an appropriate tiling.
4 # This can take longer.
----> 5 pred = model.predict(img, axes='YXC')

File ~/Desktop/N2VTensorFlow/n2vTF/lib/python3.8/site-packages/n2v/models/n2v_standard.py:382, in N2V.predict(self, img, axes, resizer, n_tiles, tta)
380 if n_tiles:
381 new_n_tiles = tuple([n_tiles[axes.index(c)] for c in axes if c != 'C']) + (n_tiles[axes.index('C')],)
--> 382 normalized = self.normalize(np.moveaxis(img, axes.index('C'), -1), means, stds)
383 else:
384 normalized = self.normalize(img[..., np.newaxis], means, stds)

File ~/Desktop/N2VTensorFlow/n2vTF/lib/python3.8/site-packages/n2v/models/n2v_standard.py:341, in N2V.normalize(self, data, means, stds)
340 def normalize(self, data, means, stds):
--> 341 return (data - means) / stds

ValueError: operands could not be broadcast together with shapes (359,497,4) (1,1,3)`

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

1 participant