ValueError : tf.function-decorated 함수가 첫 번째가 아닌 호출에서 변수를 만들려고했습니다. 的 解决 方式

훈련 프로세스 전에 다음 코드를 추가하십시오.
여기에 사진 설명 삽입

tf.config.experimental_run_functions_eagerly(True)

따라서이 블로그 게시물의 내용과 다음 링크를 참조 하십시오 :
https://blog.csdn.net/weixin_43824178/article/details/99297237

https://www.tensorflow.org/guide/effective_tf2#use_tfconfigexperimental_run_functions_eagerly_when_debugging

추천

출처blog.csdn.net/weixin_42887138/article/details/115096687