맨 위에
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
추가하면 된다.
※ Example Code ※
import torch
import torchvision.models as models
import struct
from torchsummary import summary
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
def main():
print('cuda device count: ', torch.cuda.device_count())
# net = torch.load('vgg.pth')
net = models.efficientnet_b0(pretrained=True)
net = net.to('cuda:0')
net = net.eval()
print('model: ', net)
# print('state dict: ', net.state_dict().keys())
tmp = torch.ones(1, 3, 224, 224).to('cuda:0')
print('input: ', tmp)
out = net(tmp)
print('output:', out)
summary(net, (3, 224, 224))
'Deep Learning > Pytorch' 카테고리의 다른 글
Model FLOPS 계산하기 (0) | 2023.08.03 |
---|---|
C++, Pytorch 사용 예시 - Visual Studio 2019 (0) | 2022.11.15 |
C++, Pytorch 적용하기 02 (.pt 만들기) - Visual Studio 2019 (0) | 2022.11.02 |
33_Xception (0) | 2022.04.20 |
32_DenseNet (0) | 2022.04.11 |