作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在根据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/
我是一名优秀的程序员,十分优秀!