質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
Windows 10

Windows 10は、マイクロソフト社がリリースしたOSです。Modern UIを標準画面にした8.1から、10では再びデスクトップ主体に戻され、UIも変更されています。PCやスマホ、タブレットなど様々なデバイスに幅広く対応していることが特徴です。

深層学習

深層学習は、多数のレイヤのニューラルネットワークによる機械学習手法。人工知能研究の一つでディープラーニングとも呼ばれています。コンピューター自体がデータの潜在的な特徴を汲み取り、効率的で的確な判断を実現することができます。

機械学習

機械学習は、データからパターンを自動的に発見し、そこから知能的な判断を下すためのコンピューターアルゴリズムを指します。人工知能における課題のひとつです。

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

Q&A

解決済

2回答

4367閲覧

TensorFlow Object Detection APIで学習できません。

SakuSakuLab

総合スコア8

Windows 10

Windows 10は、マイクロソフト社がリリースしたOSです。Modern UIを標準画面にした8.1から、10では再びデスクトップ主体に戻され、UIも変更されています。PCやスマホ、タブレットなど様々なデバイスに幅広く対応していることが特徴です。

深層学習

深層学習は、多数のレイヤのニューラルネットワークによる機械学習手法。人工知能研究の一つでディープラーニングとも呼ばれています。コンピューター自体がデータの潜在的な特徴を汲み取り、効率的で的確な判断を実現することができます。

機械学習

機械学習は、データからパターンを自動的に発見し、そこから知能的な判断を下すためのコンピューターアルゴリズムを指します。人工知能における課題のひとつです。

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

0グッド

1クリップ

投稿2019/09/03 08:31

前提・実現したいこと

TensorFlow Object Detection APIを使って独自データセットで学習をさせたいと考えています。

説明が足りないところは聞いていただければすぐに答えます。

2つの問題が生じていると考えています。
0. 学習ステップ数が0のまま。
0. 学習済みモデルを使えていない。

概要

時系列に沿って説明します。

機械学習自体が初めてなので、基本的には、
TensorFlow Object Detection API tutorialのとおりに実行しています。

1,[Installation]の頁
2,[Detect Objects Using Your Webcam]の頁
はデモが動くのでうまくいっていると思います。

3,Training Custom Object Detectorの頁

ここで問題が生じています。
tutorialと全く同じ名前のフォルダを、tutorialのとおりに配置しています。

trainning_demoフォルダの中身は

training_demo
├─ annotations (label_map.pbtxt, test.record, train.record, test_labels.csv,   │         train_labels.csv)
├─ images (全画像+それぞれの画像の.xmlファイル)
│ ├─ test (test画像+それぞれの画像の.xmlファイル)
│ └─ train (train画像+それぞれの画像の.xmlファイル)
├─ pre-trained-model (ssd_inception_v2_coco_2018_01_28.tar.gzを解凍したもの)
├─ training (ssd_inception_v2_coco.config)
├─ train.py (TensorFlow/models/research/object_detection/legacy/train.pyをコピーしたもの)

pre-trained-modelフォルダには
[COCO-trained models]のssd_mobilenet_v2_cocoをDL, 解凍した中身
(checkpoint, frozen_inference_graph.pb, model.ckpt.data-00000-of-00001, model.ckpt.index, model.ckpt.meta,
pipeline.configという各種ファイル + saved_modelというフォルダ)が入っています。

画像は20枚で1枚の画像に3-6つラベルしています。
ラベルは1種類です。
すべて.jpg形式で300x400 pix程度です。
train画像16枚、test画像4枚に分けました。

trainingフォルダにあるファイルは
ssd_inception_v2_coco.configを改変したものです。
変更したのは
num_classes: 90から1へ
train_configの
fine_tune_checkpoint:, input_path:, label_map_path:
eval_configの
input_path:, label_map_path:
をフルパスで指定しています。

model { ssd { num_classes: 1 box_coder { ・・・・・・・・・・・・・・・・・・・・・・・・・・・・    省略します    ・・・・・・・・・・・・・・・・・・・・・・・・・・・・ } } box_predictor { convolutional_box_predictor { min_depth: 0 max_depth: 0 num_layers_before_predictor: 0 use_dropout: false dropout_keep_probability: 0.8 kernel_size: 3 box_code_size: 4 apply_sigmoid_to_scores: false conv_hyperparams { activation: RELU_6, regularizer { l2_regularizer { weight: 0.00004 } } initializer { truncated_normal_initializer { stddev: 0.03 mean: 0.0 } } } } } feature_extractor { type: 'ssd_inception_v2' min_depth: 16 depth_multiplier: 1.0 conv_hyperparams { activation: RELU_6, regularizer { l2_regularizer { weight: 0.00004 } } initializer { truncated_normal_initializer { stddev: 0.03 mean: 0.0 } } batch_norm { train: true, scale: true, center: true, decay: 0.9997, epsilon: 0.001, } } override_base_feature_extractor_hyperparams: true } loss { classification_loss { weighted_sigmoid { } } localization_loss { weighted_smooth_l1 { } } hard_example_miner { num_hard_examples: 3000 iou_threshold: 0.99 loss_type: CLASSIFICATION max_negatives_per_positive: 3 min_negatives_per_image: 0 } classification_weight: 1.0 localization_weight: 1.0 } normalize_loss_by_num_matches: true post_processing { batch_non_max_suppression { score_threshold: 1e-8 iou_threshold: 0.6 max_detections_per_class: 100 max_total_detections: 100 } score_converter: SIGMOID } } } train_config: { batch_size: 24 optimizer { rms_prop_optimizer: { learning_rate: { exponential_decay_learning_rate { initial_learning_rate: 0.004 decay_steps: 800720 decay_factor: 0.95 } } momentum_optimizer_value: 0.9 decay: 0.9 epsilon: 1.0 } } fine_tune_checkpoint: "C:\Users\SakuLab2\Documents\TensorFlow\workspace\training_demo\pre-trained-model\model.ckpt" from_detection_checkpoint: true num_steps: 200000 data_augmentation_options { random_horizontal_flip { } } data_augmentation_options { ssd_random_crop { } } } train_input_reader: { tf_record_input_reader { input_path: "C:\Users\SakuLab2\Documents\TensorFlow\workspace\training_demo\annotations\train.record" } label_map_path: "C:\Users\SakuLab2\Documents\TensorFlow\workspace\training_demo\annotations\label_map.pbtxt" } eval_config: { num_examples: 8000 # Note: The below line limits the evaluation process to 10 evaluations. # Remove the below line to evaluate indefinitely. max_evals: 10 } eval_input_reader: { tf_record_input_reader { input_path: "C:\Users\SakuLab2\Documents\TensorFlow\workspace\training_demo\annotations\test.record" } label_map_path: "C:\Users\SakuLab2\Documents\TensorFlow\workspace\training_demo\annotations\label_map.pbtxt" shuffle: false num_readers: 1 }

tutorial通りに
train.pyが入っているTensorFlow\workspace\training_demoのディレクトリに移動し、
以下のコマンドを実行しました。

python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/ssd_inception_v2_coco.config

するとエラーを吐き出します。

発生している問題・エラーメッセージ

WARNING:root:Variable [FeatureExtractor/InceptionV2/Conv2d_1a_7x7/BatchNorm/beta/ExponentialMovingAverage] is not available in checkpoint WARNING:root:Variable [FeatureExtractor/InceptionV2/Conv2d_1a_7x7/BatchNorm/beta/RMSProp] is not available in checkpoint ・・・・・・ 似たようなメッセージが延々続くため、かなり省略。 ・・・・・・ WARNING:root:Variable [FeatureExtractor/InceptionV2/Mixed_5c_2_Conv2d_5_3x3_s2_128/weights/RMSProp] is not available in checkpoint WARNING:root:Variable [FeatureExtractor/InceptionV2/Mixed_5c_2_Conv2d_5_3x3_s2_128/weights/RMSProp_1] is not available in checkpoint

試したこと

学習済みのモデルと今のモデルが合っていないのではないかと、DLからやり直しましたが駄目でした。
別のモデルのペアでやっても似たようなメッセージが出ます。

しばらく別のメッセージの後、次のメッセージが出ます。

name: GeForce RTX 2080 major: 7 minor: 5 memoryClockRate(GHz): 1.83 pciBusID: 0000:17:00.0 totalMemory: 8.00GiB freeMemory: 6.55GiB 2019-09-03 16:13:53.388657: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1432] Found device 1 with properties: name: GeForce RTX 2080 major: 7 minor: 5 memoryClockRate(GHz): 1.83 pciBusID: 0000:65:00.0 totalMemory: 8.00GiB freeMemory: 6.55GiB 2019-09-03 16:13:53.406710: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1511] Adding visible gpu devices: 0, 1 2019-09-03 16:13:54.905149: I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] Device interconnect StreamExecutor with strength 1 edge matrix: 2019-09-03 16:13:54.914554: I tensorflow/core/common_runtime/gpu/gpu_device.cc:988] 0 1 2019-09-03 16:13:54.918857: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1001] 0: N N 2019-09-03 16:13:54.923367: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1001] 1: N N 2019-09-03 16:13:54.926699: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 6294 MB memory) -> physical GPU (device: 0, name: GeForce RTX 2080, pci bus id: 0000:17:00.0, compute capability: 7.5) 2019-09-03 16:13:54.940144: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:1 with 6294 MB memory) -> physical GPU (device: 1, name: GeForce RTX 2080, pci bus id: 0000:65:00.0, compute capability: 7.5) INFO:tensorflow:Restoring parameters from C:\Users\SakuLab2\Documents\TensorFlow\workspace\training_demo\pre-trained-model\model.ckpt INFO:tensorflow:Restoring parameters from C:\Users\SakuLab2\Documents\TensorFlow\workspace\training_demo\pre-trained-model\model.ckpt INFO:tensorflow:Running local_init_op. INFO:tensorflow:Running local_init_op. INFO:tensorflow:Done running local_init_op. INFO:tensorflow:Done running local_init_op. INFO:tensorflow:Starting Session. INFO:tensorflow:Starting Session. INFO:tensorflow:Saving checkpoint to path training/model.ckpt INFO:tensorflow:Saving checkpoint to path training/model.ckpt INFO:tensorflow:Starting Queues. INFO:tensorflow:Starting Queues. INFO:tensorflow:global_step/sec: 0 INFO:tensorflow:global_step/sec: 0 INFO:tensorflow:Recording summary at step 0. INFO:tensorflow:Recording summary at step 0.

これで終了してしまいます。
期待している以下のようなメッセージが出てきません。
INFO:tensorflow:global step 1: loss = 13.8886 (12.339 sec/step)
...

TensorBoardでtotallossなどを確認しても
1点しかでてきません。
これは1回しかステップをおこなっていないということでしょうか?

補足情報

OS : windows10
CPU : Intel(R)Core(TM)i9-9900X CPU @ 3.50GHz
RAM : 128 GB
64bit OS
グラボ :ZOTAC GAMING GeForce RTX 2080 AMP Edition (2台)

tensorflow-gpu 1.12.0
CUDA V9.0.176
cuDNN v7.1.3

tutorialではtensorflow-gpu 1.9, cuDNN v7.0.5でしたが
そのままではデモでエラーが出るので、指示どおりにupしました。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

meg_

2019/09/04 06:09

train.pyをデバッグ出来ませんか?
SakuSakuLab

2019/09/04 07:14

ご返信ありがとうございます。 問題No.2 学習済みモデルを使えていない。 の方は解決しましたが、 問題No.1 学習ステップ数が0のまま。 の方はあいかわらず未解決です。 train.pyはtutorialのとおりに TensorFlow/models/research/object_detection/legacy/train.py をコピーしたものです。 中身を下記に書いておきます。 デバッグとのことですが、 初学者のため、どこを触ればいいのか検討も付きません。 ご教授の方、できましたらお願いします。 また、githubのissueから同じ問題を抱えている方が、 (https://github.com/tensorflow/models/issues/3877) 画像サイズを小さくした(341*341を1/4程度にresize)ら上手くいったとのことでしたので 同じように画像を46*90 pix 程度に小さくしましたが、 相変わらずstep 0で終了してしまいます。 ###以下はtrain.pyの中身です。 # Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== r"""Training executable for detection models. This executable is used to train DetectionModels. There are two ways of configuring the training job: 1) A single pipeline_pb2.TrainEvalPipelineConfig configuration file can be specified by --pipeline_config_path. Example usage: ./train \ --logtostderr \ --train_dir=path/to/train_dir \ --pipeline_config_path=pipeline_config.pbtxt 2) Three configuration files can be provided: a model_pb2.DetectionModel configuration file to define what type of DetectionModel is being trained, an input_reader_pb2.InputReader file to specify what training data will be used and a train_pb2.TrainConfig file to configure training parameters. Example usage: ./train \ --logtostderr \ --train_dir=path/to/train_dir \ --model_config_path=model_config.pbtxt \ --train_config_path=train_config.pbtxt \ --input_config_path=train_input_config.pbtxt """ import functools import json import os import tensorflow as tf from object_detection.builders import dataset_builder from object_detection.builders import graph_rewriter_builder from object_detection.builders import model_builder from object_detection.legacy import trainer from object_detection.utils import config_util tf.logging.set_verbosity(tf.logging.INFO) flags = tf.app.flags flags.DEFINE_string('master', '', 'Name of the TensorFlow master to use.') flags.DEFINE_integer('task', 0, 'task id') flags.DEFINE_integer('num_clones', 1, 'Number of clones to deploy per worker.') flags.DEFINE_boolean('clone_on_cpu', False, 'Force clones to be deployed on CPU. Note that even if ' 'set to False (allowing ops to run on gpu), some ops may ' 'still be run on the CPU if they have no GPU kernel.') flags.DEFINE_integer('worker_replicas', 1, 'Number of worker+trainer ' 'replicas.') flags.DEFINE_integer('ps_tasks', 0, 'Number of parameter server tasks. If None, does not use ' 'a parameter server.') flags.DEFINE_string('train_dir', '', 'Directory to save the checkpoints and training summaries.') flags.DEFINE_string('pipeline_config_path', '', 'Path to a pipeline_pb2.TrainEvalPipelineConfig config ' 'file. If provided, other configs are ignored') flags.DEFINE_string('train_config_path', '', 'Path to a train_pb2.TrainConfig config file.') flags.DEFINE_string('input_config_path', '', 'Path to an input_reader_pb2.InputReader config file.') flags.DEFINE_string('model_config_path', '', 'Path to a model_pb2.DetectionModel config file.') FLAGS = flags.FLAGS @tf.contrib.framework.deprecated(None, 'Use object_detection/model_main.py.') def main(_): assert FLAGS.train_dir, '`train_dir` is missing.' if FLAGS.task == 0: tf.gfile.MakeDirs(FLAGS.train_dir) if FLAGS.pipeline_config_path: configs = config_util.get_configs_from_pipeline_file( FLAGS.pipeline_config_path) if FLAGS.task == 0: tf.gfile.Copy(FLAGS.pipeline_config_path, os.path.join(FLAGS.train_dir, 'pipeline.config'), overwrite=True) else: configs = config_util.get_configs_from_multiple_files( model_config_path=FLAGS.model_config_path, train_config_path=FLAGS.train_config_path, train_input_config_path=FLAGS.input_config_path) if FLAGS.task == 0: for name, config in [('model.config', FLAGS.model_config_path), ('train.config', FLAGS.train_config_path), ('input.config', FLAGS.input_config_path)]: tf.gfile.Copy(config, os.path.join(FLAGS.train_dir, name), overwrite=True) model_config = configs['model'] train_config = configs['train_config'] input_config = configs['train_input_config'] model_fn = functools.partial( model_builder.build, model_config=model_config, is_training=True) def get_next(config): return dataset_builder.make_initializable_iterator( dataset_builder.build(config)).get_next() create_input_dict_fn = functools.partial(get_next, input_config) env = json.loads(os.environ.get('TF_CONFIG', '{}')) cluster_data = env.get('cluster', None) cluster = tf.train.ClusterSpec(cluster_data) if cluster_data else None task_data = env.get('task', None) or {'type': 'master', 'index': 0} task_info = type('TaskSpec', (object,), task_data) # Parameters for a single worker. ps_tasks = 0 worker_replicas = 1 worker_job_name = 'lonely_worker' task = 0 is_chief = True master = '' if cluster_data and 'worker' in cluster_data: # Number of total worker replicas include "worker"s and the "master". worker_replicas = len(cluster_data['worker']) + 1 if cluster_data and 'ps' in cluster_data: ps_tasks = len(cluster_data['ps']) if worker_replicas > 1 and ps_tasks < 1: raise ValueError('At least 1 ps task is needed for distributed training.') if worker_replicas >= 1 and ps_tasks > 0: # Set up distributed training. server = tf.train.Server(tf.train.ClusterSpec(cluster), protocol='grpc', job_name=task_info.type, task_index=task_info.index) if task_info.type == 'ps': server.join() return worker_job_name = '%s/task:%d' % (task_info.type, task_info.index) task = task_info.index is_chief = (task_info.type == 'master') master = server.target graph_rewriter_fn = None if 'graph_rewriter_config' in configs: graph_rewriter_fn = graph_rewriter_builder.build( configs['graph_rewriter_config'], is_training=True) trainer.train( create_input_dict_fn, model_fn, train_config, master, task, FLAGS.num_clones, worker_replicas, FLAGS.clone_on_cpu, ps_tasks, worker_job_name, is_chief, FLAGS.train_dir, graph_hook_fn=graph_rewriter_fn) if __name__ == '__main__': tf.app.run()
SakuSakuLab

2019/09/04 11:53 編集

画像を認識できていないのではないかと考えて、 画像が入っているimagesフォルダの中身をすべて削除しました。 同じように、学習させるコマンドを打ち込んだところ これまでと全く同じメッセージが帰ってきました。 ということは、画像を認識できておらず、 何も学習しないまま終了、となっていると思います。 ということは画像が入ったフォルダのパスを指定できていないということでしょうか? labelImgによる注釈、その後の.xml to .csv変換、.csv to .record変換のあたりをもう少し調べてみます。
SakuSakuLab

2019/09/04 11:55

.recordファイルができれば、 画像フォルダのパスは不用なんですね。 .recordファイルが上手くできてなさそうな気がしてきました。 重点的に調べてみます。 .csvは見れるので上手くできているのは確認しました。
guest

回答2

0

ベストアンサー

cpu版ですが試してみました。チュートリアル通りでは色々エラーが出たため、tensorflowを最新にアップデートしたら学習スタートしました。

昨日csv→record変換の際、ファイルを手修正したような気がします。csvファイルの画像ファイル名に拡張子がなくてrecordファイルが0バイトになってしまったような気がします。(うろ覚えです)

投稿2019/09/04 12:29

meg_

総合スコア10577

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

SakuSakuLab

2019/09/04 13:05

ご回答、本当にありがとうございます。 tensorflowのバージョンが原因ということでしょうか。 確かにtutorial通りの1.8だと「installation」のところでエラーが出るので1.12にしました。 「installation」の方では、エラーが出ないようにはしたのですが、、、。 独自データを学習させるコマンドを実行すると「一応」pipeline.configやら、model.ckpt-0.data-0000-....などのファイルは 作ってくれているのでtensorflow-gpuの方は問題がないとタカをくくっていました。 tensorflow-gpuを最新バージョンにするとcuda, cudnnも新しいのにしないといけないので一からやり直します。 csv→record変換の件ですが、 最初の方、私も0バイトになってしまうことがありました。 今では新しく作り直すと、0バイトということはないし、 csvのファイルの方もきちんと.jpgの拡張子はありました。 ただ、.recordファイルが正常か確認する方法がないのが辛いです。 いずれにしても ・tensorflow-gpuを最新版(+cuda, cudnnもversion up)にしてみる。 ・.xml→.csv変換・.csv→.record変換を別のスクリプトを使ってみる。 の2つを試したいと思います。 そこで質問が2つあります。 1,tensorflowの最新バージョンは2.0 rc と 1.14のどちらでしょうか? 2,「チュートリアル通りでは色々エラーが出たため」とありますが、  エラーは「installation」の方で出たのでしょうか?それとも「Training Custom Object Detector」の方の物体検出の学習の方で出たのでしょうか? ご教示の程よろしくお願いします。
meg_

2019/09/04 13:21

エラーが出ていないのであればアップデートしなくても良いかもしれませんね。。 私のエラーはtrain.pyを実行すると、tensorflowのv.1.2以上でないと使えない属性にモデル(object-detection以下のスクリプト)がアクセスしていたため発生していました。 verは1.14です。
meg_

2019/09/04 13:23

ところでPythonのバージョンは何ですか?
SakuSakuLab

2019/09/04 23:22

warningは出るんですが、 errorは出ないんですよ。だから厄介でして。 Pythonは3.6.7です。 tutorial通りに3.6を使っています。 tensorflow-gpuのversionも上げたので pythonも上げた方がいいということでしょうか? ちなみにmeg_様のpython versionはいくつでしょうか? とりあえずtensorflowのCPU版でいけるかやってみようと思います。
SakuSakuLab

2019/09/05 02:14

meg_様 コメントありがとうございます。 CPU版ですが、学習することができました! (下記メッセージご参照、途中ですが、、、。) tensorflow-gpu版のときと比較すると、 ・Pythonは3.6.7で同じ。 ・.recordファイル、modelのconfigファイル、既存学習モデルの.ckptなどは全く同じファイルを使っています。 ですので、.recordファイルなどはおかしなことは起きていないのではないかと考えています。 違いは、 tensorflow-gpuはver 1.12に対し、 tensorflowは ver 1.14のところです。 tensorflow-gpuも1.14にupしてやってみます! 一歩前進しました! ありがとうございます。 ぬか喜びかもしれませんが、、、。 メッセージ・・・・・・・・・・・・・・・・・・・・・・・・ Instructions for updating: Use standard file APIs to check for files with this prefix. W0905 11:01:21.498098 20924 deprecation.py:323] From C:\Users\SakuLab2\Anaconda3\envs\tensorflow_cpu\lib\site-packages\tensorflow\python\training\saver.py:1276: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version. Instructions for updating: Use standard file APIs to check for files with this prefix. INFO:tensorflow:Restoring parameters from pre-trained-model/model.ckpt I0905 11:01:21.502088 20924 saver.py:1280] Restoring parameters from pre-trained-model/model.ckpt INFO:tensorflow:Running local_init_op. I0905 11:01:22.152181 20924 session_manager.py:500] Running local_init_op. INFO:tensorflow:Done running local_init_op. I0905 11:01:22.660507 20924 session_manager.py:502] Done running local_init_op. INFO:tensorflow:Starting Session. I0905 11:01:30.344474 20924 learning.py:754] Starting Session. INFO:tensorflow:Saving checkpoint to path training/model.ckpt I0905 11:01:30.744078 19688 supervisor.py:1117] Saving checkpoint to path training/model.ckpt INFO:tensorflow:Starting Queues. I0905 11:01:30.754052 20924 learning.py:768] Starting Queues. INFO:tensorflow:global_step/sec: 0 I0905 11:01:43.839699 25488 supervisor.py:1099] global_step/sec: 0 INFO:tensorflow:Recording summary at step 0. I0905 11:01:45.463365 19100 supervisor.py:1050] Recording summary at step 0. INFO:tensorflow:global step 1: loss = 15.0142 (18.576 sec/step) I0905 11:01:49.641272 20924 learning.py:507] global step 1: loss = 15.0142 (18.576 sec/step) INFO:tensorflow:global step 2: loss = 13.7035 (4.109 sec/step) I0905 11:01:54.074517 20924 learning.py:507] global step 2: loss = 13.7035 (4.109 sec/step) INFO:tensorflow:global step 3: loss = 13.4717 (4.089 sec/step) I0905 11:01:58.163869 20924 learning.py:507] global step 3: loss = 13.4717 (4.089 sec/step) INFO:tensorflow:global step 4: loss = 11.8779 (4.105 sec/step) I0905 11:02:02.270146 20924 learning.py:507] global step 4: loss = 11.8779 (4.105 sec/step) INFO:tensorflow:global step 5: loss = 11.0423 (4.176 sec/step) I0905 11:02:06.447849 20924 learning.py:507] global step 5: loss = 11.0423 (4.176 sec/step) INFO:tensorflow:global step 6: loss = 10.0427 (4.083 sec/step) I0905 11:02:10.533131 20924 learning.py:507] global step 6: loss = 10.0427 (4.083 sec/step) INFO:tensorflow:global step 7: loss = 10.5421 (4.107 sec/step) I0905 11:02:14.640893 20924 learning.py:507] global step 7: loss = 10.5421 (4.107 sec/step) INFO:tensorflow:global step 8: loss = 9.3204 (4.131 sec/step) I0905 11:02:18.774255 20924 learning.py:507] global step 8: loss = 9.3204 (4.131 sec/step) INFO:tensorflow:global step 9: loss = 8.7274 (4.089 sec/step) I0905 11:02:22.864851 20924 learning.py:507] global step 9: loss = 8.7274 (4.089 sec/step) INFO:tensorflow:global step 10: loss = 9.2415 (4.122 sec/step) I0905 11:02:26.987646 20924 learning.py:507] global step 10: loss = 9.2415 (4.122 sec/step) INFO:tensorflow:global step 11: loss = 7.4162 (4.086 sec/step) I0905 11:02:31.076937 20924 learning.py:507] global step 11: loss = 7.4162 (4.086 sec/step) INFO:tensorflow:global step 12: loss = 8.7699 (4.088 sec/step) I0905 11:02:35.166142 20924 learning.py:507] global step 12: loss = 8.7699 (4.088 sec/step) INFO:tensorflow:global step 13: loss = 6.8626 (4.096 sec/step) I0905 11:02:39.264580 20924 learning.py:507] global step 13: loss = 6.8626 (4.096 sec/step) INFO:tensorflow:global step 14: loss = 6.5997 (4.062 sec/step) I0905 11:02:43.328536 20924 learning.py:507] global step 14: loss = 6.5997 (4.062 sec/step) INFO:tensorflow:global step 15: loss = 6.1440 (4.061 sec/step) I0905 11:02:47.390534 20924 learning.py:507] global step 15: loss = 6.1440 (4.061 sec/step) INFO:tensorflow:global step 16: loss = 5.9572 (4.063 sec/step) I0905 11:02:51.455469 20924 learning.py:507] global step 16: loss = 5.9572 (4.063 sec/step) INFO:tensorflow:global step 17: loss = 5.3785 (4.062 sec/step) I0905 11:02:55.519807 20924 learning.py:507] global step 17: loss = 5.3785 (4.062 sec/step) INFO:tensorflow:global step 18: loss = 5.6430 (4.043 sec/step) I0905 11:02:59.564519 20924 learning.py:507] global step 18: loss = 5.6430 (4.043 sec/step) INFO:tensorflow:global step 19: loss = 6.2075 (4.047 sec/step) I0905 11:03:03.614156 20924 learning.py:507] global step 19: loss
meg_

2019/09/05 03:58 編集

そうですか。CPU版だとものすごく時間かかりますからね。。 GPU版固有の問題でしょうか? すみません。チュートリアルにはv7と書いてありますね。↓ 「cudnn v6のみ対応しているらしい」との情報を見つけました! https://qiita.com/onlyzs/items/3d78942625970b428d24
SakuSakuLab

2019/09/05 06:15

meg_様 GPU版でもいけました!!! 2つのご指摘 1,tensorflow-gpu upgrade to v1.14 2,cudnn downgrade to v6 のうち、 まず1,tensorflow-gpu v1.12 to v1.14 (+CUDA, cuDNNのversion up) をおこなったところ学習がきちんとスタートしました。 tensorflow-gpu 1.14.0 CUDA 10.0 cuDNN 9.4.1 です。 .recordファイル、model configファイルなどは 昔の上手くいってなかったときと同じものを使っています。 ですので、 tensorflow-gpuのversionが原因であったと結論づけました。 一連のアドバイス大変参考になりました。 機械学習&pythonの入門者でしたので どのようにトラブルシュートしてよいか途方に暮れていました。 meg_様の助けで乗り切ることができました。 本当に感謝します。 解決済み&ベストアンサーにします。 今後ともどうぞよろしくお願いします。
guest

0

2つの問題のうち
2.学習済みモデルを使えていない。
は解決しました。

WARNING:root:Variable [FeatureExtractor/InceptionV2/Conv2d_1a_7x7/BatchNorm/beta/ExponentialMovingAverage] is not available in checkpoint
というエラーが延々と出るので、既存の学習モデルを利用できていないと考えていました。
ここのコメントにあるようにmodelからではなく、optimizerから発生するエラーのようで私のprocedureには何も影響がないそうです。

ただ、引き続き、問題1 学習ステップ数が0のまま。
は解決できてません。

INFO:tensorflow:global_step/sec: 0
INFO:tensorflow:Recording summary at step 0.
で終わってしまい、

INFO:tensorflow:global step 1: loss = 13.8886 (12.339 sec/step)
INFO:tensorflow:global step 2: loss = 9.8716 (9.339 sec/step)
INFO:tensorflow:global step 3: loss = 5.8716 (4.226 sec/step)
...
のようなコメントが出てきません。

ご教示の程、よろしくお願いします。

投稿2019/09/04 01:59

SakuSakuLab

総合スコア8

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問