-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Issues importing my own dataset #366
Comments
I just ran into the same issue and looked into the code. It looks like the errors are caused by using the Since all my images are already sized, cropped, and share a consistent colorspace, I simply skipped the wonky code by commenting lines return transform(image, input_height, input_width,
resize_height, resize_width, crop) And substituting with: return image Everything appears to be working smoothly now and my model is fitting. Give it a shot? |
It looks like that worked. Thank you for your help! |
changed the code became a new error... [] Reading checkpoints... ./out\20191014.164103 - data - faces - x108.z100.uniform_signed.y64.b64\checkpoint |
是utils.py 文件中的imread函数导致的问题,最后return的时候转换成了float,crop的时候Image.fromarray这句就会报错, |
另外,transform函数中有严重的bug |
Same problem! |
Yes, from zhihu link "https://zhuanlan.zhihu.com/p/24767059" the @igoindown ’s comment, His solution is working for me: 我运行过程中一共遇到了4个问题: 1:TypeError: Cannot handle this data type 跟着代码一步步crtl+b进utils.py把94行改为: im = Image.fromarray(np.uint8(x[j:j+crop_h, i:i+crop_w])) 2:再run; 95行会报错 data type not understood 把95行改为:return np.array(im.resize([resize_h, resize_w]), np.uint8(Image.BILINEAR)) 3:再运行会提示resize_h没有定义。这里不知道是不是bug。我整个把97行的transform函数改为如下: def transform(image, input_height, input_width, 4:此时函数已经可以正常运行了,但是不能存图。 原因:utils.py中 scipy.misc.imsave被弃用 添加imageio库。用imageio.imwrite代替 大功告成! translate version: 1:TypeError: Cannot handle this data type Follow the code step by step crtl+b into utils.py to change line 94 to: Im = Image.fromarray(np.uint8(x[j:j+crop_h, i:i+crop_w])) 2: Run again; 95 lines will report error data type not understood Change line 95 to: return np.array(im.resize([resize_h, resize_w]), np.uint8(Image.BILINEAR)) 3: Re-run will prompt resize_h is not defined. I don't know if it is a bug here. I changed the 97-line transform function to the following: Def transform(image, input_height, input_width, 4: The function is now ready to run, but it cannot be saved. Cause: scipy.misc.imsave is deprecated in utils.py Add the imageio library. Replace with imageio.imwrite You're done! |
Thank U soooo much for your help!!! |
thank you! |
你好,我根据你的修改了transform,还是会显示j,j+crop_h,i,i+crop_w未被定义,请问是什么原因呢 |
I have been troubleshooting this for a few days now and I think it's about time to ask.
I have tried importing a couple of datasets that I reshaped with PIL to 96x96(RGB).
When I use one of the datasets and specify the input_height and output_height flags i get this error:
When I specify the --crop flag I get this:
With all this being said, I think it is an issue with my images and the crop function. I have used the mnist dataset and it works fine.
For reference on what my images are, I have attached two.
If you have any advice on what I can change to fix this issue I would really appreciate it.
The text was updated successfully, but these errors were encountered: