2 글 보임 - 1 에서 2 까지 (총 2 중에서)
-
글쓴이글
-
2023년 2월 15일 21:23 #68509
달새벽참가자-- 마지막 모델 실행 부분 -- X = num_images for j in range(300): print(f'epoch = {j}') ohgood() for i in range(100000//128): if i % 100 == 0: print(f'batch{i}') #discriminator train
real_X = X[i*128:(i+1)*128] real_Y = np.ones(shape=(128,1)) loss1 = discriminator.train_on_batch(real_X, real_Y)
fake_X = generator.predict(np.random.uniform(-1,1,size=(128,100))) fake_Y = np.zeros(shape=(128,1)) loss2 = discriminator.train_on_batch(fake_X, fake_Y)
#generator train
create_X = generator.predict(np.random.uniform(-1,1,size=(128,100))) create_Y = np.ones(shape=(128,1)) loss3 = GAN.train_on_batch(create_X, create_Y) print(f'epoch loss is {loss1+loss2} / {loss3}') -- 마지막 모델 실행부분 끝 -- -- 에러코드 --
epoch = 0 1/1 [==============================] - 0s 19ms/step
batch0
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-19-fe8cf86441b2> in <module> 10 real_X = X[i*128:(i+1)*128] 11 real_Y = np.ones(shape=(128,1)) ---> 12 loss1 = discriminator.train_on_batch(real_X, real_Y) 13 14 fake_X = generator.predict(np.random.uniform(-1,1,size=(128,100)))
2 frames /usr/local/lib/python3.8/dist-packages/keras/engine/training.py in train_on_batch(self, x, y, sample_weight, class_weight, reset_metrics, return_dict) 2476 ) 2477 self.train_function = self.make_train_function() -> 2478 logs = self.train_function(iterator) 2479 2480 logs = tf_utils.sync_to_numpy_or_python_type(logs)
/usr/local/lib/python3.8/dist-packages/tensorflow/python/util/traceback_utils.py in error_handler(*args, **kwargs) 151 except Exception as e: 152 filtered_tb = _process_traceback_frames(e.__traceback__) --> 153 raise e.with_traceback(filtered_tb) from None 154 finally: 155 del filtered_tb
/usr/local/lib/python3.8/dist-packages/tensorflow/python/eager/polymorphic_function/polymorphic_function.py in _call(self, *args, **kwds) 910 # In this case we have created variables on the first call, so we run the 911 # defunned version which is guaranteed to never create variables. --> 912 return self._no_variable_creation_fn(*args, **kwds) # pylint: disable=not-callable 913 elif self._variable_creation_fn is not None: 914 # Release the lock early so that multiple threads can perform the call
TypeError: 'NoneType' object is not callable
-- 에러코드 끝 -- 무슨에러인지 찾아봤는데 해결방법을 모르겠어서 질문드립니다. 에러코드중 /usr/local/lib/python3.8/dist-packages/keras/engine/training.py in train_on_batch(self, x, y, sample_weight, class_weight, reset_metrics, return_dict) 2476 ) 2477 self.train_function = self.make_train_function() -> 2478 logs = self.train_function(iterator) 2479 2480 logs = tf_utils.sync_to_numpy_or_python_type(logs) 이부분이 키포인트인건가요..?
-
글쓴이글
2 글 보임 - 1 에서 2 까지 (총 2 중에서)
- 답변은 로그인 후 가능합니다.