Framework: Pytorch
wandb version : 0.13.3
workspace: Google colab
config = dict(
dropout = 0.4,
train_batch = 3,
val_batch = 1,
test_batch = 1,
learning_rate = 0.001,
epochs = 5,
architecture = "CNN",
model_name = "efficientnet-b0",
infra = "Colab",
dataset="dysphagia_dataset2"
)
My test function
def test_model():
running_correct = 0.0
running_total = 0.0
true_labels = []
pred_labels = []
with torch.no_grad():
for data in dataloaders[TEST]:
inputs, labels = data
inputs = inputs.to(device)
labels = labels.to(device)
true_labels.append(labels.item())
outputs = model_ft(inputs)
_, preds = torch.max(outputs.data, 1)
pred_labels.append(preds.item())
running_total += labels.size(0)
running_correct += (preds == labels).sum().item()
acc = running_correct/running_total
return (true_labels, pred_labels, running_correct, running_total, acc)
true_labels, pred_labels, running_correct, running_total, acc = test_model()
Error
AttributeError Traceback (most recent call last)
<ipython-input-26-b7dbeaddcbbb> in <module>
----> 1 true_labels, pred_labels, running_correct, running_total, acc = test_model()
2
4 frames
/usr/local/lib/python3.7/dist-packages/wandb/wandb_torch.py in log_tensor_stats(self, tensor, name)
254 bins = torch.Tensor(bins_np)
255
--> 256 wandb.run._log(
257 {name: wandb.Histogram(np_histogram=(tensor.tolist(), bins.tolist()))},
258 commit=False,
AttributeError: 'NoneType' object has no attribute '_log'
This is how i initialize training:
model_ft = train_model(model_ft,
criterion,
optimizer_ft,
config
)
my wandb init:
wandb.init(config=config,
name='efficientnet0+albumentions',
group='pytorch-efficientnet-baseline',
project='dysphagia_image_classification',
job_type='train')
config = wandb.config