혼공머신 p502 질문

5 views
Skip to first unread message

Edward

unread,
Apr 3, 2022, 8:51:34 AM4/3/22
to 머신러닝/딥러닝 도서 Q&A
쥬피터 노트북 (환경 python=3.7, tensorflow: 2.3)에서 아래와 같이 처음에 데이터 나누는 것을 손코딩할때 (p502) 아래와 같이 에러가 뜹니다. 코랩은 괜찮은데 쥬피터 노트북은 왜 그런건가요? 

[손코딩]
from tensorflow.keras.datasets import imdb
(train_input, train_target), (test_input, test_target) = imdb.load_data(num_words=500)

[에러]
<div><br class="Apple-interchange-newline">from tensorflow.keras.datasets import imdb (train_input, train_target), (test_input, test_target) = imdb.load_data(num_words=500)</div>
from tensorflow.keras.datasets import imdb(train_input, train_target), (test_input, test_target) = imdb.load_data(num_words=500)
<string>:6: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray. C:\Users\13773041\AppLockerExceptions\Anaconda3\envs\jys_py\lib\site-packages\tensorflow\python\keras\datasets\imdb.py:159: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray. x_train, y_train = np.array(xs[:idx]), np.array(labels[:idx]) C:\Users\13773041\AppLockerExceptions\Anaconda3\envs\jys_py\lib\site-packages\tensorflow\python\keras\datasets\imdb.py:160: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray. x_test, y_test = np.array(xs[idx:]), np.array(labels[idx:])

Haesun Park

unread,
Apr 3, 2022, 10:29:02 AM4/3/22
to Edward, 머신러닝/딥러닝 도서 Q&A
안녕하세요. 박해선입니다.

넘파이 패키지에서 출력하는 경고입니다.
가능하면 텐서플로와 넘파이 최신 버전을 사용하세요.

감사합니다.

2022년 4월 3일 (일) 오후 9:51, Edward <edward...@gmail.com>님이 작성:
--
이 메일은 Google 그룹스 '머신러닝/딥러닝 도서 Q&A' 그룹에 가입한 분들에게 전송되는 메시지입니다.
이 그룹에서 탈퇴하고 더 이상 이메일을 받지 않으려면 ml-dl-book-qn...@googlegroups.com에 이메일을 보내세요.
웹에서 이 토론을 보려면 https://groups.google.com/d/msgid/ml-dl-book-qna/63f68a43-523e-4e68-bd88-f6ea2bbe4078n%40googlegroups.com을(를) 방문하세요.
Reply all
Reply to author
Forward
0 new messages