前提・実現したいこと
現在このqiitaのサイトで扱っているこのgithubを試しています。
images/
|→forest_mod
|→mtg_land_mod
フォルダを作成し、それぞれシマウマの画像5枚、普通の馬画像を5枚入れて
挙動を確認しています。
発生している問題・エラーメッセージ
(cycleganio) C:\Users\imcla\Desktop\500io\cycleGAN_keras>python train.py Using TensorFlow backend. 2019-10-24 17:26:08.307816: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 Compile Discriminators Compile Generatorその1 ./images\forest_mod*.jpg 1 ./images\mtg_land_mod*.jpg 1 C:\Users\imcla.conda\envs\cycleganio\lib\site-packages\keras\engine\training.py:297: UserWarning: Discrepancy between trainable weights and collected trainable weights, did you set `model.trainable` without calling `model.compile` after ? 'Discrepancy between trainable weights and collected trainable' C:\Users\imcla.conda\envs\cycleganio\lib\site-packages\keras\engine\training.py:297: UserWarning: Discrepancy between trainable weights and collected trainable weights, did you set `model.trainable` without calling `model.compile` after ? 'Discrepancy between trainable weights and collected trainable' epoch 0 0/1000 loss_d_x:0.8669 loss_d_y:0.6979 loss_g:19.5365 74.02秒 2 2 2019-10-24 17:27:28.245006: W tensorflow/core/common_runtime/base_collective_executor.cc:216] BaseCollectiveExecutor::StartAbort Failed precondition: Error while reading resource variable _AnonymousVar393 from Container: localhost. This could mean that the variable was uninitialized. Not found: Resource localhost/_AnonymousVar393/class tensorflow::Var does not exist. [[{{node mul_243/ReadVariableOp}}]] Traceback (most recent call last): File "train.py", line 12, in <module> model.train() File "C:\Users\imcla\Desktop\500io\cycleGAN_keras\cycleGAN.py", line 88, in train G=inference_model_G, F=inference_model_F) File "C:\Users\imcla\Desktop\500io\cycleGAN_keras\cycleGAN.py", line 234, in training_iteration "G": batch_B, "F": batch_A}) File "C:\Users\imcla.conda\envs\cycleganio\lib\site-packages\keras\engine\training.py", line 1514, in train_on_batch outputs = self.train_function(ins) File "C:\Users\imcla.conda\envs\cycleganio\lib\site-packages\tensorflow_core\python\keras\backend.py", line 3740, in __call__ outputs = self._graph_fn(*converted_inputs) File "C:\Users\imcla.conda\envs\cycleganio\lib\site-packages\tensorflow_core\python\eager\function.py", line 1081, in __call__ return self._call_impl(args, kwargs) File "C:\Users\imcla.conda\envs\cycleganio\lib\site-packages\tensorflow_core\python\eager\function.py", line 1121, in _call_impl return self._call_flat(args, self.captured_inputs, cancellation_manager) File "C:\Users\imcla.conda\envs\cycleganio\lib\site-packages\tensorflow_core\python\eager\function.py", line 1224, in _call_flat ctx, args, cancellation_manager=cancellation_manager) File "C:\Users\imcla.conda\envs\cycleganio\lib\site-packages\tensorflow_core\python\eager\function.py", line 511, in call ctx=ctx) File "C:\Users\imcla.conda\envs\cycleganio\lib\site-packages\tensorflow_core\python\eager\execute.py", line 67, in quick_execute six.raise_from(core._status_to_exception(e.code, message), None) File "<string>", line 3, in raise_from tensorflow.python.framework.errors_impl.FailedPreconditionError: Error while reading resource variable _AnonymousVar393 from Container: localhost. This could mean that the variable was uninitialized. Not found: Resource localhost/_AnonymousVar393/class tensorflow::Var does not exist. [[node mul_243/ReadVariableOp (defined at C:\Users\imcla.conda\envs\cycleganio\lib\site-packages\tensorflow_core\python\framework\ops.py:1751) ]] [Op:__inference_keras_scratch_graph_61310] Function call stack: keras_scratch_graph
なるエラーメッセージが出力されます。
File "C:\Users\imcla.conda\envs\cycleganio\lib\site-packages\tensorflow_core\python\eager\execute.py"
が何かしら原因がある?と思います。以下がそのコードです。
字数的に端折っています。
execute.py(一部抜粋)
1 except core._NotOkStatusException as e: 2 if name is not None: 3 message = e.message + " name: " + name 4 else: 5 message = e.message 6 7 six.raise_from(core._status_to_exception(e.code, message), None)#ここでエラー 8 except TypeError as e: 9 keras_symbolic_tensors = [ 10 x for x in inputs if ops._is_keras_symbolic_tensor(x) 11 ] 12 if keras_symbolic_tensors: 13 raise core._SymbolicException( 14 "Inputs to eager execution function cannot be Keras symbolic " 15 "tensors, but found {}".format(keras_symbolic_tensors)) 16 raise e 17 # pylint: enable=protected-access 18 return tensors 19
試したこと
エラー文で検索したところこちらのページがありましたが、変数初期値がまずいとのことですが、私は全くいじっていません。
tensorflowのバージョン等も原因があるのでしょうか?
詳しい方、ご教授お願い致します。
実行環境
windows10
Anaconda python3.6
conda
1# packages in environment at C:\Users\imcla.conda\envs\cycleganio: 2# 3# Name Version Build Channel 4absl-py 0.8.1 pypi_0 pypi 5astor 0.8.0 pypi_0 pypi 6certifi 2019.9.11 py36_0 7cycler 0.10.0 pypi_0 pypi 8decorator 4.4.0 pypi_0 pypi 9gast 0.2.2 pypi_0 pypi 10google-pasta 0.1.7 pypi_0 pypi 11grpcio 1.24.3 pypi_0 pypi 12h5py 2.10.0 pypi_0 pypi 13imageio 2.6.1 pypi_0 pypi 14keras 2.3.1 pypi_0 pypi 15keras-applications 1.0.8 pypi_0 pypi 16keras-preprocessing 1.1.0 pypi_0 pypi 17kiwisolver 1.1.0 pypi_0 pypi 18markdown 3.1.1 pypi_0 pypi 19matplotlib 3.1.1 pypi_0 pypi 20networkx 2.4 pypi_0 pypi 21numpy 1.17.3 pypi_0 pypi 22opt-einsum 3.1.0 pypi_0 pypi 23pandas 0.25.2 pypi_0 pypi 24pillow 6.2.1 pypi_0 pypi 25pip 19.3.1 py36_0 26protobuf 3.10.0 pypi_0 pypi 27pyparsing 2.4.2 pypi_0 pypi 28python 3.6.9 h5500b2f_0 29python-dateutil 2.8.0 pypi_0 pypi 30pytz 2019.3 pypi_0 pypi 31pywavelets 1.1.1 pypi_0 pypi 32pyyaml 5.1.2 pypi_0 pypi 33scikit-image 0.16.2 pypi_0 pypi 34scipy 1.3.1 pypi_0 pypi 35setuptools 41.4.0 py36_0 36six 1.12.0 pypi_0 pypi 37sqlite 3.30.0 he774522_0 38tensorboard 2.0.0 pypi_0 pypi 39tensorflow 2.0.0 pypi_0 pypi 40tensorflow-estimator 2.0.1 pypi_0 pypi 41termcolor 1.1.0 pypi_0 pypi 42vc 14.1 h0510ff6_4 43vs2015_runtime 14.16.27012 hf0eaf9b_0 44werkzeug 0.16.0 pypi_0 pypi 45wheel 0.33.6 py36_0 46wincertstore 0.2 py36h7fe50ca_0 47wrapt 1.11.2 pypi_0 pypi
回答1件
あなたの回答
tips
プレビュー