본문 바로가기

Error and Solve

[에러 해결] UserWarning: None of the inputs have requires_grad=True. Gradients will be None / warnings.filterwarnings

반응형

 

 

 

 

UserWarning: None of the inputs have requires_grad=True. Gradients will be None

 

UserWarning: None of the inputs have requires_grad=True. Gradients will be None

위의 경고문이 너무 자주 나타나서 끄고 싶었다.

 

 

 

 

해결: import warnings; warnings.filterwarnings

 

import warnings
warnings.filterwarnings("ignore", category=UserWarning)
import warnings
warnings.filterwarnings("ignore", category=UserWarning)

 

 

위의 코드를 코드 맨 윗부분에 넣으면 된다. 

 

 

 

 

 

 

해결.

 

 

 

반응형