Imdb Error shows up, when i try to download LSUN dataset with pytorch

Viewed 205

Recently I try to read LSUN dataset and train a DL network. But error shows up when I run the following code.

import torch
import torchvision
import torchvision.transforms as transforms
import time
from torch import nn, optim
import numpy as np
import matplotlib.pyplot as plt
root='d:/datasets/'
lsun_dataset = torchvision.datasets.LSUN(root=root, classes=['restaurant_train'], transform=transforms.Compose([
                                   transforms.Resize(96),
                                   transforms.RandomCrop(64),
                                   transforms.ToTensor(),
                                   transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5)),
                               ]))

print(lsun_dataset);

the error message is as below.

    Traceback (most recent call last):
  File "D:\coding\paper\lsgan\dataloadingtest.py", line 13, in <module>
    transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5)),
  File "d:\anaconda\lib\site-packages\torchvision\datasets\lsun.py", line 83, in __init__
    transform=transform))
  File "d:\anaconda\lib\site-packages\torchvision\datasets\lsun.py", line 25, in __init__
    readahead=False, meminit=False)
lmdb.Error: d:/datasets//restaurant_train_lmdb: \u03f5\u0373\ufffd\u04b2\ufffd\ufffd\ufffd\u05b8\ufffd\ufffd\ufffd\ufffd��\ufffd\ufffd\ufffd\ufffd

can anyone tell me how to fix it? Thx.

Platform: Windows 10, Python version: 3.7.3

0 Answers
Related