Python20 파일이 존재하는데 'No such file or directory' error가 날 때 파일 경로를 아래와 같이 설정해두었었는데 parser.add_argument('--data', type=str, default='/cache/data/') # './cache'와 'cache'는 같은 것 default='cache/data/' 혹은 default='./cache/data/'으로 저장해야 한다. 2023. 10. 13. [error] Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same for i , (inputs, labels) in enumerate(trainloader, 0): inputs, labels = inputs.to(device), labels.to(device) optimizer.zero_grad() #### error 가 난 위치 outputs = net(inputs) #### loss = criterion(outputs, labels) input은 device("cuda") 로 설정해준반면 모델인 net는 설정해주지 않아 발생한 에러이다. 2023. 6. 16. 이전 1 2 3 4 다음