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

안녕하세요 reshape 함수에 대해 도움을 주시면 감사하겠습니다. #33

Open
smj21 opened this issue Apr 7, 2018 · 0 comments

Comments

@smj21
Copy link

smj21 commented Apr 7, 2018

올려주신 코드를 보고 연습을 하고 있는데 다음과 같은 문제가 생깁니다.
코드:
for i in range(total_batch):
batch_xs, batch_ys = data.next_batch(BatchSize=batch_size, shuffle=data_shuffle)
batch_xs = np.asarray(batch_xs)
batch_ys = np.asarray(batch_ys)
batch_xs = batch_xs.reshape(-1, 48, 48, 1)

    _, cost_val = sess.run([optimizer, cost],
                           feed_dict={X: batch_xs,Y: batch_ys,keep_prob: 0.7})
    total_cost += cost_val
    data_shuffle = False

*batch size = 50입니다.
X = tf.placeholder(tf.float32, [None, 48, 48, 1])
Y = tf.placeholder(tf.float32, [None, 7])
keep_prob = tf.placeholder(tf.float32)

이러식으로 돌렸을 때, 오류문이 다음과 같이 나옵니다.
ValueError : cannot reshape array of size 50 into shape (48,48,1)

현재 파이썬3에서 위 코드를 돌리고 있는데, 버전이 달라서 reshape 함수가 안돌아가는 건가요?

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