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

ValueError #2

Open
db3ppp opened this issue Jan 7, 2020 · 4 comments
Open

ValueError #2

db3ppp opened this issue Jan 7, 2020 · 4 comments

Comments

@db3ppp
Copy link

db3ppp commented Jan 7, 2020

in grayimage/mainimprovement.py , the following error occurs..

get_batch_y = get_batch_y.astype('float32')/255.0
ValueError: setting an array element with a sequence.

I tried printing out 'get_batch_y' and found that its getting only the batch size and no other information.
get_batch_y.shape = (20,)
type(get_batch_y) = np.array

Do you know any possible solution for these problems?

@hellloxiaotian
Copy link
Owner

get_batch_y has three dimensions. You may try the following: print((get_batch_y.shape[0], get_batch_y.shape[1], get_batch_y.shape[2], 1)).

@db3ppp
Copy link
Author

db3ppp commented Jan 8, 2020

I tried the following:
if the batch_size is 20, it is not printed at all. If the batch size is 8, it is printed only once. if the batch size is 4, only two times, then a valueError is displayed..

캡처
<batch_size: 8>

1
<batch_size: 4>

@db3ppp
Copy link
Author

db3ppp commented Jan 8, 2020

Only when batch size 1, no error occurs...

@hellloxiaotian
Copy link
Owner

hellloxiaotian commented Jan 8, 2020

Please check your running environment. If your running environment is the same as mine, it doesn't have error. Also, I run my code again. It doesn't have error as follows.
111

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