Hi @artsiom ,
Thanks for the response!
Currently I find for example this run is taking a very long time to load the image (even just for one image). But well I’m not sure if it will still be loading when you see it …
Also, even when it is loading, I can directly see this image from the Files button so the image should have been uploaded.
In terms of the code, the complete code is kind of complicated but basically like this: I first trained a model, created a wandb run. Then (in another code) I load the data saved during training and make some figures, and I resume that wandb run and log the figures to that run as wandb.Image
The code snippet for logging the image is
plt.figure(dpi = 256)
plt.xlim(-4,6)
plt.ylim(-4,6)
_m_train_Y = m_train_Y.detach().cpu()
_m_test_Y = m_test_Y .detach().cpu()
plt.scatter( _m_train_Y[:,0] , _m_train_Y[:,1] , s = 5 ,label = "train")
plt.scatter( _m_test_Y[:,0] , _m_test_Y[:,1] , s = 20 ,label = "test", marker = "^")
pred_Ys = []
checkpoints = rec_G.summarize("checkpoints", lambda dic_check:[dic_check[_] for _ in dic_check])
for epoch_idx in tqdm(checkpoints):
model = rec_G.get_remote(f"saved_checkpoints/{epoch_idx}.pkl").to(C["device"]).eval()
pred_Y = model(my_test_X).detach().cpu()[0]
_, m_pred_Y = map_2d_identity(None , pred_Y, info, C["device"])
pred_Ys.append(m_pred_Y)
plt.scatter( [float(_[0]) for _ in pred_Ys][:1], [float(_[1]) for _ in pred_Ys][:1] , s = 20 , c = "r" , marker = "v" ,label = "starting point")
plt.plot( [float(_[0]) for _ in pred_Ys] , [float(_[1]) for _ in pred_Ys], markersize = 3 , c = "orange", marker = "o" , label = "model curve")
plt.legend()
plt.title(f"{rec_C['group']}/{rec_C['info']}")
I think it’s nothing new but just make some figures by matplotlib and log the image to a wandb run…
please let me know if you need more information!