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

Tutorial on dl.ksvd has incorrect syntax #6

Open
NickiShaw opened this issue Jun 17, 2021 · 0 comments
Open

Tutorial on dl.ksvd has incorrect syntax #6

NickiShaw opened this issue Jun 17, 2021 · 0 comments

Comments

@NickiShaw
Copy link

I am having trouble with dl.ksvd, using the tutorial code below (trying to train on my own image - 'image_rescaled'). Here is my code:

1. image_patches = dl.Patches(image_rescaled.astype(float), 8)
2. dictionary_a = dl.dct_dict(256, 8)
3. dictionary_b = dl.ksvd(image_patches, dictionary_a, 1, n_nonzero=8, n_threads=4, verbose=True)
4. dl.visualize_dictionary(dictionary_b, 16, 16)

And the error:
AttributeError: 'tuple' object has no attribute 'shape'

The problem occurs when I try visualize_dictionary, but changing line 4 to:
dl.visualize_dictionary(dictionary_b[0], 16, 16)
solves this problem. The code looks fine but the tutorial is a bit misleading - since dictionary_a is not the same as dictionary_b (dictionary_b is a tuple).

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