【问题标题】:Using your own evaluation and training set in cloud-ml-engine sample在 cloud-ml-engine 示例中使用您自己的评估和训练集
【发布时间】:2018-09-21 03:23:25
【问题描述】:

在谷歌的鲜花教程中:https://cloud.google.com/ml-engine/docs/tensorflow/flowers-tutorial
对于数据的预处理,我们使用了 dollwoing 命令:

python trainer/preprocess.py \
--input_dict "$DICT_FILE" \
--input_path "gs://cloud-ml-data/img/flower_photos/train_set.csv" \
--output_path "${GCS_PATH}/preproc/train" \
--cloud

我知道我们可以用我们自己的列表替换 csv 文件,从而用一组不同的图像进行训练,但是为超过 100 种类型的图像创建 csv 文件会很麻烦,有没有办法克服这个问题?

【问题讨论】:

    标签: tensorflow computer-vision google-cloud-platform prediction tensorflow-serving


    【解决方案1】:

    train_set.csv 是 Google Cloud Storage 中的文件路径列表和预测标签。

    这是文件的一部分:

    gs://cloud-ml-data/img/flower_photos/daisy/754296579_30a9ae018c_n.jpg,daisy
    gs://cloud-ml-data/img/flower_photos/dandelion/18089878729_907ed2c7cd_m.jpg,dandelion
    gs://cloud-ml-data/img/flower_photos/dandelion/284497199_93a01f48f6.jpg,dandelion
    gs://cloud-ml-data/img/flower_photos/dandelion/3554992110_81d8c9b0bd_m.jpg,dandelion
    gs://cloud-ml-data/img/flower_photos/daisy/4065883015_4bb6010cb7_n.jpg,daisy
    gs://cloud-ml-data/img/flower_photos/roses/7420699022_60fa574524_m.jpg,roses
    gs://cloud-ml-data/img/flower_photos/dandelion/4558536575_d43a611bd4_n.jpg,dandelion
    gs://cloud-ml-data/img/flower_photos/daisy/7568630428_8cf0fc16ff_n.jpg,daisy
    gs://cloud-ml-data/img/flower_photos/tulips/7064813645_f7f48fb527.jpg,tulips
    gs://cloud-ml-data/img/flower_photos/sunflowers/4933229095_f7e4218b28.jpg,sunflowers
    gs://cloud-ml-data/img/flower_photos/daisy/14523675369_97c31d0b5b.jpg,daisy
    gs://cloud-ml-data/img/flower_photos/sunflowers/21518663809_3d69f5b995_n.jpg,sunflowers
    gs://cloud-ml-data/img/flower_photos/dandelion/15782158700_3b9bf7d33e_m.jpg,dandelion
    gs://cloud-ml-data/img/flower_photos/tulips/8713398906_28e59a225a_n.jpg,tulips
    gs://cloud-ml-data/img/flower_photos/tulips/6770436217_281da51e49_n.jpg,tulips
    gs://cloud-ml-data/img/flower_photos/dandelion/8754822932_948afc7cef.jpg,dandelion
    gs://cloud-ml-data/img/flower_photos/daisy/22873310415_3a5674ec10_m.jpg,daisy
    gs://cloud-ml-data/img/flower_photos/sunflowers/5967283168_90dd4daf28_n.jpg,sunflowers
    

    因此,您必须为自己的火车组收集一组图像,将其上传到 GCS 并对它们进行分类。然后你只需要检索路径列表(使用gsutil ls 命令可以轻松实现)并与分类标签连接。

    【讨论】:

      猜你喜欢
      • 2018-04-22
      • 2018-03-24
      • 2012-08-27
      • 2019-08-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-06
      相关资源
      最近更新 更多