코드입니다
출력은 대충 이렇게 나옵니다.
2024-07-12 12:07:30.344063: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2024-07-12 12:07:30.923519: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
c:\Users\d4143\AppData\Local\Programs\Python\Python312\Lib\site-packages\keras\src\layers\core\dense.py:87: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
super().__init__(activity_regularizer=activity_regularizer, **kwargs)
Traceback (most recent call last):
", line 31, in <module>
Dense(128, activation='SiLU', input_shape=(784,)), # 첫 번째 은닉층: 128개의 뉴런, Leaky ReLU 활성화 함수 적용
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
line 89, in __init__
self.activation = activations.get(activation)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
line 104, in get
raise ValueError(
ValueError: Could not interpret activation function identifier: SiLU
stackoverflow에 검색해도 나오지 않아 여기에 질문드립니다. sigmoid함수나 tanh같은 건 잘 돌아가는데 왜 swish만 안 될까요?
ㅋㅋ 프갤에 물어볼 시간에 gpt에 물어보겠다 - dc App
gpt한테 물어봐도 안 고쳐지길래요.
ValueError: Could not interpret activation function identifier: SiLU 맨 마지막줄에 이게 핵심같은데... 그냥 relu함수는 실행 잘됨?
꼭 silu 쓰고싶으면 차라리 파이토치 써봐. 텐서플로우는 파이토치랑 비교해서는 이젠 서비스 종료 수준이라 걍 파이토치가 나음. 코드 보니깐 텐서플로우에는 silu 활성함수가 내장되어 있지 않아서 직접 구현한거 같은데 걍 파이토치 쓰는거 추천함.
Dense(128, activation='SiLU', input_shape=(784,)), # 첫 번째 은닉층: 128개의 뉴런, Leaky ReLU 활성화 함수 적용 <- 그리고 이부분 말인데 왜 silu썼는데 주석은 Leaky Relu인거?
그리고 코드 보면 sillu함수 정의할때 numpy 쓰고있는데 케라스에서 쓸려면 tensorflow 써서 구현해야함.