本文整理汇总了Python中data.custom_dataset_data_loader.CustomDatasetDataLoader方法的典型用法代码示例。如果您正苦于以下问题:Python custom_dataset_data_loader.CustomDatasetDataLoader方法的具体用法?Python custom_dataset_data_loader.CustomDatasetDataLoader怎么用?Python custom_dataset_data_loader.CustomDatasetDataLoader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类data.custom_dataset_data_loader
的用法示例。
在下文中一共展示了custom_dataset_data_loader.CustomDatasetDataLoader方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from data import custom_dataset_data_loader [as 别名]
# 或者: from data.custom_dataset_data_loader import CustomDatasetDataLoader [as 别名]
def __init__(self):
self._opt = TrainOptions().parse()
data_loader_train = CustomDatasetDataLoader(self._opt, is_for_train=True)
data_loader_test = CustomDatasetDataLoader(self._opt, is_for_train=False)
self._dataset_train = data_loader_train.load_data()
self._dataset_test = data_loader_test.load_data()
self._dataset_train_size = len(data_loader_train)
self._dataset_test_size = len(data_loader_test)
print('#train images = %d' % self._dataset_train_size)
print('#test images = %d' % self._dataset_test_size)
self._model = ModelsFactory.get_by_name(self._opt.model, self._opt)
self._tb_visualizer = TBVisualizer(self._opt)
self._train()
示例2: CreateDataLoader
# 需要导入模块: from data import custom_dataset_data_loader [as 别名]
# 或者: from data.custom_dataset_data_loader import CustomDatasetDataLoader [as 别名]
def CreateDataLoader(opt):
from data.custom_dataset_data_loader import CustomDatasetDataLoader
data_loader = CustomDatasetDataLoader()
print(data_loader.name())
data_loader.initialize(opt)
return data_loader
示例3: CreateDataLoader
# 需要导入模块: from data import custom_dataset_data_loader [as 别名]
# 或者: from data.custom_dataset_data_loader import CustomDatasetDataLoader [as 别名]
def CreateDataLoader(datafolder,dataroot='./dataset',dataset_mode='2afc',load_size=64,batch_size=1,serial_batches=True,nThreads=4):
from data.custom_dataset_data_loader import CustomDatasetDataLoader
data_loader = CustomDatasetDataLoader()
# print(data_loader.name())
data_loader.initialize(datafolder,dataroot=dataroot+'/'+dataset_mode,dataset_mode=dataset_mode,load_size=load_size,batch_size=batch_size,serial_batches=serial_batches, nThreads=nThreads)
return data_loader
示例4: CreateDataLoader
# 需要导入模块: from data import custom_dataset_data_loader [as 别名]
# 或者: from data.custom_dataset_data_loader import CustomDatasetDataLoader [as 别名]
def CreateDataLoader(opt):
data_loader = CustomDatasetDataLoader()
print(data_loader.name())
data_loader.initialize(opt)
return data_loader