PyTorch 코드 관련 이슈

한량1111·2021년 8월 21일

[U-stage] PyTorch for AI

목록 보기
6/6

Codes

  1. Colab 기본 mpl은 3.2.2 버전이라 pip install을 이용해 수동 다운로드 해줘야됨
import numpy as np 
import matplotlib as mpl

!pip install matplotlib==3.3.4
print(f'numpy version : {np.__version__}') # version check
print(f'matplotlib version : {mpl.__version__}') # version check
  1. plt.subplots로 바로 fig, ax를 만들 때 x,y 축 모두 길이를 2 이상으로 선언하면 2차원 배열이 만들어지기 때문에
    접근할 때 2차원식 접근을 하거나 flatten을 해야 순서대로 접근 가능
fig, axes = plt.subplots(2, 3, figsize=(13, 4))
axes = axes.flatten()
profile
즐겁게 개발하기

0개의 댓글