是否存在通过利用动态图属性来利用pytorch训练多个模型的标准方法?
答案 0 :(得分:0)
DataLoader与模型无关。这是您可以做什么的示例。
import torch
import torch.nn as nn
class Model(nn.Module):
# Model definition
#Two models with different hyper-parameters
model1 = Model(args)
model2 = Model(args)
dataloader = torch.utils.data.DataLoader(args)
for data in dataloader:
# Train model1
for data in dataloader:
# Train model2