我正在狗与猫数据集上构建 Keras 深度学习算法。我可以在 colab 中运行我的代码。但在 Jupyter 实验室中我收到此错误。
The following argument(s) are not supported with the native Keras format: ['options']
Run Code Online (Sandbox Code Playgroud)
下面是代码:
import os
import shutil
import pathlib
original_dir = pathlib.Path("/content/drive/MyDrive/Reva/dogs_vs_cats/train/train")
new_base_dir = pathlib.Path("/content/drive/MyDrive/Reva/dogs_vs_cats/")
def make_subset(subset_name, start_index, end_index):
for category in ("cat", "dog"):
dir = new_base_dir / subset_name / category
# Check if the folder exists and delete it if it does
if os.path.exists(dir):
shutil.rmtree(dir)
# Create the folder again
os.makedirs(dir)
fnames = [f"{category}.{i}.jpg" for i in range(start_index, end_index)]
for fname in …Run Code Online (Sandbox Code Playgroud)