'module' object is not callable

조회수 475회

이미지

tensorboard_log는 모듈이 아닌데 모듈을 불러올수가 없다고 하네요. 왜그럴까요?

1 답변

  • TypeError: 'xxx' is not callable 은 함수가 아닌 것을 함수호출처럼 썼을 때, ( 즉, 바로 뒤에 () 가 있을 때 ) 발생합니다.

    예를 보여드릴께요.

    >>> a = 1
    >>> a()
    Traceback (most recent call last):
      File "<pyshell#3>", line 1, in <module>
        a()
    TypeError: 'int' object is not callable
    
    >>> b = "abc"
    >>> b(3, 4)
    Traceback (most recent call last):
      File "<pyshell#4>", line 1, in <module>
        b(3, 4)
    TypeError: 'str' object is not callable
    
    
    >>> c = range(32)
    >>> c(33, "a")
    Traceback (most recent call last):
      File "<pyshell#5>", line 1, in <module>
        c(33, "a")
    TypeError: 'range' object is not callable
    

답변을 하려면 로그인이 필요합니다.

프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)