• 로그인
  • 장바구니에 상품이 없습니다.

home2 게시판 Python, SQL 게시판 텐서플로우 예제 에러

텐서플로우 예제 에러

2 글 보임 - 1 에서 2 까지 (총 2 중에서)
  • 글쓴이
  • #115209

    임태섭
    참가자
    import tensorflow as tf
    키 = 170
    신발 = 260
    a = tf.Variable(0.1)
    b = tf.Variable(0.2)
    def lossFunc():
        return tf.square(260 - 키*a+b)
    opt = tf.keras.optimizers.Adam(learning_rate = 0.1)
    opt.minimize(lossFunc, var_list = [a,b])
    
    에러
    PS C:\Users\USER\Desktop\폴더> python tensor.py
    2024-03-05 19:32:22.271715: 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-03-05 19:32:23.536344: 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-03-05 19:32:26.012849: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
    To enable the following instructions: AVX2 AVX_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
    Traceback (most recent call last):
      File "C:\Users\USER\Desktop\폴더\tensor.py", line 13, in <module>
        opt.minimize(lossFunc, var_list = [a,b])
        ^^^^^^^^^^^^
    AttributeError: 'Adam' object has no attribute 'minimize'
    
    어떻게 고치나요?
    
    
    #115221

    codingapple
    키 마스터
    텐서플로우 1말고 2버전 설치하면 사용가능합니다 colab에서 해봅시다
2 글 보임 - 1 에서 2 까지 (총 2 중에서)
  • 답변은 로그인 후 가능합니다.

About

현재 월 700명 신규수강중입니다.

  (09:00~20:00) 빠른 상담은 카톡 플러스친구 코딩애플 (링크)
  admin@codingapple.com
  이용약관
ⓒ Codingapple, 강의 예제, 영상 복제 금지
top

© Codingapple, All rights reserved. 슈퍼로켓 에듀케이션 / 서울특별시 강동구 고덕로 19길 30 / 사업자등록번호 : 212-26-14752 온라인 교육학원업 / 통신판매업신고번호 : 제 2017-서울강동-0002 호 / 개인정보관리자 : 박종흠