8
import tensorflow as tf
import tensorflow
from tensorflow import keras
from keras.layers import Dense
Tôi nhận được báo lỗi dưới đâyLàm thế nào để nhập khẩu keras từ tf.keras trong Tensorflow?
from keras.layers import Input, Dense
Traceback (most recent call last):
File "<ipython-input-6-b5da44e251a5>", line 1, in <module>
from keras.layers import Input, Dense
ModuleNotFoundError: No module named 'keras'
Làm thế nào để giải quyết này?
Lưu ý: Tôi đang sử dụng Tensorflow phiên bản 1.4
Bất kỳ ý tưởng nào để tìm layer_utils? Nó sử dụng được nhập khẩu như sau: từ keras.utils layer_utils nhập khẩu Tuy nhiên, sau gợi ý của bạn ở trên: tensorflow.python.keras.utils nhập layer_utils kết quả trong các lỗi: ImportError: không thể nhập tên ' layer_utils ' –