我启动GAN网络并收到消息-函数调用堆栈:keras_scratch_graph

时间:2020-02-01 11:39:44

标签: python keras generative-adversarial-network

使用TensorFlow后端。 2020-02-01 13:25:02.491404:I tensorflow / core / platform / cpu_feature_guard.cc:142]您的CPU支持该TensorFlow二进制文件未编译为使用的指令:AVX2 型号:“ sequential_1”

_________________________________________________________________
Layer (type)                 Output Shape              Param #   
=================================================================
flatten_1 (Flatten)          (None, 784)               0         
_________________________________________________________________
dense_1 (Dense)              (None, 512)               401920    
_________________________________________________________________
leaky_re_lu_1 (LeakyReLU)    (None, 512)               0         
_________________________________________________________________
dense_2 (Dense)              (None, 256)               131328    
_________________________________________________________________
leaky_re_lu_2 (LeakyReLU)    (None, 256)               0         
_________________________________________________________________
dense_3 (Dense)              (None, 1)                 257       
=================================================================
Total params: 533,505
Trainable params: 533,505
Non-trainable params: 0
_________________________________________________________________
Model: "sequential_2"
_________________________________________________________________
Layer (type)                 Output Shape              Param #   
=================================================================
dense_4 (Dense)              (None, 256)               25856     
_________________________________________________________________
leaky_re_lu_3 (LeakyReLU)    (None, 256)               0         
_________________________________________________________________
batch_normalization_1 (Batch (None, 256)               1024      
_________________________________________________________________
dense_5 (Dense)              (None, 512)               131584    
_________________________________________________________________
leaky_re_lu_4 (LeakyReLU)    (None, 512)               0         
_________________________________________________________________
batch_normalization_2 (Batch (None, 512)               2048      
_________________________________________________________________
dense_6 (Dense)              (None, 1024)              525312    
_________________________________________________________________
leaky_re_lu_5 (LeakyReLU)    (None, 1024)              0         
_________________________________________________________________
batch_normalization_3 (Batch (None, 1024)              4096      
_________________________________________________________________
dense_7 (Dense)              (None, 784)               803600    
_________________________________________________________________
reshape_1 (Reshape)          (None, 28, 28, 1)         0         
=================================================================
Total params: 1,493,520
Trainable params: 1,489,936
Non-trainable params: 3,584

D:\ MachineLearning \ venv \ lib \ site-packages \ keras \ engine \ training.py:297: 用户警告:可训练的重量与收集的重量之间的差异 可训练的砝码,您是否设置了model.trainable而未致电 model.compile之后? '可训练重量与 收集可训练的'0 [D损失:0.860389,总计:18.75%] [G损失: [0.704660] D:\ MachineLearning \ venv \ lib \ site-packages \ keras \ engine \ training.py:297: 用户警告:可训练的重量与收集的重量之间的差异 可训练的砝码,您是否设置了model.trainable而未致电 model.compile之后? '可训练重量与 收集可训练的'2020-02-01 13:25:10.037836:W tensorflow / core / common_runtime / base_collective_executor.cc:217] BaseCollectiveExecutor :: StartAbort失败的前提条件:时出错 从容器:本地主机读取资源变量_AnonymousVar32。 这可能意味着该变量未初始化。未找到: 资源localhost / _AnonymousVar32 / class tensorflow :: Var不 存在。 [[{{node mul / ReadVariableOp}}]]追溯(最近的呼叫 最后):文件“ D:/ MachineLearning / Machine Learning A-Z模板 文件夹/第8部分-深度学习/第40部分-卷积神经 网络(CNN)/GAN_Keras_Super_Resolution_1.py“,第165行,在 gan.train(epochs = 300,batch_size = 32,sample_interval = 20)文件“ D:/ MachineLearning / Machine Learning A-Z模板文件夹/第8部分-深入 学习/第40章-卷积神经网络 (CNN)/GAN_Keras_Super_Resolution_1.py“,第124行,在火车上 d_loss_real = self.discriminator.train_on_batch(imgs,有效)文件 “ D:\ MachineLearning \ venv \ lib \ site-packages \ keras \ engine \ training.py”, 1514行,在train_on_batch中 输出= self.train_function(ins)文件“ D:\ MachineLearning \ venv \ lib \ site-packages \ tensorflow_core \ python \ keras \ backend.py”, 第3726行,在致电中 输出= self._graph_fn(* converted_inputs)文件“ D:\ MachineLearning \ venv \ lib \ site-packages \ tensorflow_core \ python \ eager \ function.py”, 第1529行,在致电中 返回self._call_impl(args,kwargs)文件“ D:\ MachineLearning \ venv \ lib \ site-packages \ tensorflow_core \ python \ eager \ function.py”, _call_impl中的第1569行 返回self._call_flat(args,self.captured_inputs,cancel_manager)文件 “ D:\ MachineLearning \ venv \ lib \ site-packages \ tensorflow_core \ python \ eager \ function.py”, 第1670行,在_call_flat中 ctx,args,cancel_manager = cancellation_manager))文件“ D:\ MachineLearning \ venv \ lib \ site-packages \ tensorflow_core \ python \ eager \ function.py”, 523行,正在通话中 ctx = ctx)文件“ D:\ MachineLearning \ venv \ lib \ site-packages \ tensorflow_core \ python \ eager \ execute.py”, 第67行,在quick_execute中 six.raise_from(core._status_to_exception(e.code,message),None)文件“”,第3行,在raise_from中 tensorflow.python.framework.errors_impl.FailedPreconditionError: 从容器读取资源变量_AnonymousVar32时出错: 本地主机这可能意味着该变量未初始化。不 找到:资源localhost / _AnonymousVar32 / class tensorflow :: Var做 不存在。 [[node mul / ReadVariableOp(在 \ MachineLearning \ venv \ lib \ site-packages \ keras \ backend \ tensorflow_backend.py:3009) ]] [操作:__ inference_keras_scratch_graph_1753]

函数调用堆栈:keras_scratch_graph

我尝试使用我在社区答案中发现的技巧来解决类似问题,但是它们不起作用。你能帮我吗!

0 个答案:

没有答案