-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
코드 실해 해봤는데 # 정책신경망을 업데이트하는 훈련함수 생성 부분에서 에러가 나요 #59
Comments
버전이 업데이트되면서 get_updates 함수 옵션 순서와 갯수가 바뀌었습니다. 다음과 같이 해야 합니다. |
감사합니다!
2021년 11월 30일 (화) 오후 2:32, swkim01 ***@***.***>님이 작성:
… 버전이 업데이트되면서 get_updates 함수 옵션 순서와 갯수가 바뀌었습니다. 다음과 같이 해야 합니다.
updates = optimizer.get_updates(loss, self.model.trainable_weights)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#59 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AT2A6LBILSBVPFBG3MOR7KDUOROWNANCNFSM5BTQUDMA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
안녕하세요, 저도 기존 질문과 같은 에러가 있어서 말씀하신대로 위 코드로 변환하였습니다. 그랬더니, TypeError: Cannot convert a symbolic Keras input/output to a numpy array. This error may indicate that you're trying to pass a symbolic value to a NumPy call, which is not supported. Or, you may be trying to pass Keras symbolic inputs/outputs to a TF API that does not register dispatching, preventing Keras from automatically converting the API call to a lambda layer in the Functional Model. 위와 같은 에러가 발생하는데.. numpy 최신버전으로 설치해도 동일한 에러가 발생합니다. 혹시 get_updates 뿐만 아니라 다른 코드들도 수정해줘야하나요? =============================================
위 코드 입력하니까 TypeError: Cannot convert a symbolic Keras input/output to a numpy array. This error may indicate that you're trying to pass a symbolic value to a NumPy call, which is not supported. Or, you may be trying to pass Keras symbolic inputs/outputs to a TF API that does not register dispatching, preventing Keras from automatically converting the API call to a lambda layer in the Functional Model. 에러는 사라졌는데, 이제는 get_update 코드 아래 줄
위 코드가 문제입니다.. |
다음과 같이 수정해 보시기 바랍니다. 또, 아래 정책신경망_ 업데이트 함수 train_model 에서 다음과 같이 수정해야 할 겁니다. |
에러 내용 : 예외가 발생했습니다. TypeError
get_updates() takes 3 positional arguments but 4 were given
File "D:\seungwan\Desktop\AI_Study\AI_Reference\reinforcement-learning-kr-master\1-grid-world\7-reinforce\reinforce_agent.py", line 52, in optimizer
updates = optimizer.get_updates(self.model.trainable_weights, [], loss)
File "D:\seungwan\Desktop\AI_Study\AI_Reference\reinforcement-learning-kr-master\1-grid-world\7-reinforce\reinforce_agent.py", line 25, in init
self.optimizer = self.optimizer()
File "D:\seungwan\Desktop\AI_Study\AI_Reference\reinforcement-learning-kr-master\1-grid-world\7-reinforce\reinforce_agent.py", line 92, in
agent = ReinforceAgent()
The text was updated successfully, but these errors were encountered: