我正在运行Coursera的deeplearning.ai课程中的lr_utils.py
代码。
我尝试将“ train_x”,y更改为“ train_a”,b,“ train_set_x”并将y更改为a和b,代码未运行。
行train_x
和train_y
是什么意思?
字符串train_set_x
和train_set_y
到底是什么?
字符串train_set_x
和train_set_y
是否属于任何表中的列名?
谢谢
def load_train_data():
train_dataset = h5py.File('datasets/train_catvnoncat.h5', "r")
train_x = np.array(train_dataset["train_set_x"][:]) # train images
train_y = np.array(train_dataset["train_set_y"][:]) # train label
return train_x, train_y
def load_train_data():
train_dataset = h5py.File('datasets/train_catvnoncat.h5', "r")
train_a = np.array(train_dataset["train_set_a"][:]) # train images
train_b = np.array(train_dataset["train_set_b"][:]) # train label
return train_a, train_b
KeyError:“无法打开对象(对象'train_set_a'不存在)”