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

Value error on reshaping image #5

Closed
rachmadaniHaryono opened this issue Sep 24, 2016 · 3 comments
Closed

Value error on reshaping image #5

rachmadaniHaryono opened this issue Sep 24, 2016 · 3 comments

Comments

@rachmadaniHaryono
Copy link

Python 2.7.12 (default, Jul 1 2016, 15:12:24)

Traceback (most recent call last):
  File "./noteshrink.py", line 585, in <module>
    main()
  File "./noteshrink.py", line 582, in main
    notescan_main(options=get_argument_parser().parse_args())
  File "./noteshrink.py", line 557, in notescan_main
    samples = sample_pixels(img, options)
  File "./noteshrink.py", line 340, in sample_pixels
    pixels = img.reshape((-1, 3))
ValueError: total size of new array must be unchanged

test1

i have installed all requirements except notescanm which isn't pip installable.

@mzucker
Copy link
Owner

mzucker commented Sep 24, 2016

I tried running the script on the photo you attached, and it worked fine.

"notescan" is simply the original name of the repo/project before it was noteshrink, it has now been changed in the requirements.txt.

Not sure why this error is occurring. What output do you see if you insert the line

print '*** image has shape', img.shape, '***'

immediately before line 340?

@rachmadaniHaryono
Copy link
Author

rachmadaniHaryono commented Sep 24, 2016

(Pdb) img.shape
()
(Pdb) type(img.shape)
<type 'tuple'>

update :

i tried once again and now with virtualenv and it is working after i installing noteshrink from requirements. it seems like i can't run noteshrink.py directly without installing it first. is it expected behaviour?

package that installed in my python (non venv)

Pillow==3.3.1
image==1.5.4
numpy==1.11.1
scipy==0.18.1

@mzucker
Copy link
Owner

mzucker commented Sep 24, 2016

That's not expected behavior, but I don't quite know why that might be the case. I'm guessing that it's a difference between one of the package versions in your environment and mine, but can't for the life of me think of what it might be.

Closing this for now because you found a work-around.

@mzucker mzucker closed this as completed Sep 24, 2016
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