ValueError:
Unrecognized keyword arguments passed to Model:
{'input': ..., 'outputs': ...}
Keras(2.x 초반) 문법을 사용해서 난 에러. 현재는 input이 아니라 inputs로 변경되었다.
968/87910968 ━━━━━━━━━━━━━━━━━━━━ 8s 0us/step 046546944/87910968 ━━━━━━━━━━━━━━━━━━━━ 4s 0us/step
Traceback (most recent call last):
File "D:\study\sk_playdata\book\Intelligent-Projects-Using-Python\Chapter02\TransferLearning.py", line 299, in <module>
obj.main()
~~~~~~~~^^
File "D:\study\sk_playdata\book\Intelligent-Projects-Using-Python\Chapter02\TransferLearning.py", line 284, in main
self.model_save_dest = self.train_model(train_X,train_y,n_fold=self.folds,batch_size=self.batch_size,
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
epochs=self.epochs,dim=self.dim,lr=self.lr,model=self.model)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\study\sk_playdata\book\Intelligent-Projects-Using-Python\Chapter02\TransferLearning.py", line 210, in train_model
model_final = self.inception_pseudo(dim=224,freeze_layers=10,full_freeze='N')
File "D:\study\sk_playdata\book\Intelligent-Projects-Using-Python\Chapter02\TransferLearning.py", line 149, in inception_pseudo
model_final = Model(input = model.input,outputs=out)
File "C:\Users\playdata2\anaconda3\Lib\site-packages\keras\src\models\model.py", line 162, in __init__
Layer.__init__(self, *args, **kwargs)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\playdata2\anaconda3\Lib\site-packages\keras\src\layers\layer.py", line 295, in __init__
raise ValueError(
...<2 lines>...
)
ValueError: Unrecognized keyword arguments passed to Model: {'input': <KerasTensor shape=(None, None, None, 3), dtype=float32, sparse=False, ragged=False, name=keras_tensor>, 'outputs': <KerasTensor shape=(None, 5), dtype=float32, sparse=False, ragged=False, name=keras_tensor_316>}
(base) PS D:\study\sk_playdata\book\Intelligent-Projects-Using-Python>

+ 만약 위의 에러를 만났다면 해결후 아래의 에러를 만날 확률이 높다.
https://standout.tistory.com/1914
ModelCheckpoint() 확장자가 반드시 .keras여야한다. + ValueError:The filepath provided must end in `.keras`
+ ValueError:The filepath provided must end in `.keras`Received:kera1-5fold-run-01-v1-fold-02-run-02.check최신 Keras3 에서는 ModelCheckpoint() 모델을 저장할때 확장자가 반드시 .keras여야한다.callbacks = [ EarlyStopping(monitor='val_lo
standout.tistory.com