好像有一个问题?请帮忙看一下
leonlee723 opened this issue · comments
在Cbir.ipynb里,
def dataLoader( istrain=True):
trans = transforms.Compose(
[transforms.ToTensor(),
transforms.Normalize(mean, std)]
)
data_set = datasets.CIFAR100('./', train=istrain, transform=trans)
return data_set
dataset = {}
for phase in ['train', 'val']:
dataset[phase] = dataLoader(phase=='train')
会报错,大概就是说dataLoader方法没有phase这个参数,运行不过去
我测试了一下,没有问题。 你是不是把 dataLoader (phase=='train') 里面的一个等号删了。
dataLoader确实没有phase这个参数。传过去的是一个布尔值,赋值对象是 istrain。或者你试下
for phase in ['train', 'val']:
dataset[phase] = dataLoader( istrain = (phase=='train') )
leonlee723 <notifications@github.com> 于2019年2月18日周一 下午4:34写道:
… 在Cbir.ipynb里,
def dataLoader( istrain=True):
trans = transforms.Compose(
[transforms.ToTensor(),
transforms.Normalize(mean, std)]
)
data_set = datasets.CIFAR100('./', train=istrain, transform=trans)
return data_set
dataset = {}
for phase in ['train', 'val']:
dataset[phase] = dataLoader(phase=='train')
会报错,大概就是说dataLoader方法没有phase这个参数,运行不过去
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ARKxp5piW3OVi1izQ6IEJMgBQXm3DxM7ks5vOmWxgaJpZM4bAV0t>
.