gpt4 book ai didi

python - Dataset_factory导入错误: Tensorflow fine-tuning a pre-trained model from an existing checkpoint on custom data

转载 作者:行者123 更新时间:2023-11-30 09:09:04 26 4
gpt4 key购买 nike

我正在根据tensorflow github page的说明,在小型自定义数据集上重新训练预训练(inception v1)模型。

创建数据集:

python build_image_data.py 
--train_directory="${TRAIN_DIR}"
--validation_directory="${VALIDATION_DIR}"
--output_directory="${OUTPUT_DIRECTORY}"
--labels_file="${LABELS_FILE}"
--train_shards=128
--validation_shards=24
--num_threads=8

微调(https://github.com/tensorflow/models/tree/master/slim#Pretrained - 从现有检查点部分微调模型):

python train_image_classifier.py 
--train_dir="${TRAIN_DIR}"
--dataset_dir="${DATASET_DIR}"
--dataset_name=objects
--dataset_split_name=train
--model_name=inception_v1
--checkpoint_path="${CHECKPOINT_PATH}"

我收到以下错误消息:

File "train_image_classifier.py", line 23, in from datasets import dataset_factory - ImportError: no module named 'datasets'

我尝试将 dataset_factory 添加到 python 路径,但它不起作用,并且我找不到任何解决方案来解决此问题。这种情况该怎么办?

最佳答案

首先,请确保您拥有最新版本的代码 https://github.com/tensorflow/models/tree/master/slim 。检查数据集文件夹是否存在。您还可以尝试将数据集(不是 dataset_factory.py)文件夹添加到 PYTHONPATH 环境变量中。

关于python - Dataset_factory导入错误: Tensorflow fine-tuning a pre-trained model from an existing checkpoint on custom data,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44996913/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com