Hi,
I am trying to log plt plot as wandb.Image in my sweep, but I have an issue. Wandb.log will log only one first one and then it logs it all over again. Can you help me guys? Pasting my log plot code.
for name, index in zip(names, indexes):
print(index)
pca_values = PCA().fit_transform(np.append(y_pred[:,index], y_valid[:,index],0))
c_map = ["red"] * y_pred.shape[0] + ["green"] * y_valid.shape[0]
plt.scatter(pca_values[:,0], pca_values[:,1],c=c_map, s=400,alpha=0.3)
for i in range(pca_values.shape[0]):
label = f"P-{i}" if i < y_pred.shape[0] else str(i - y_pred.shape[0])
plt.text(pca_values[i,0], pca_values[i,1], label, ha="center", va="center", color='black')
plt.grid('minor')
plt.title(name)
wandb.log(
{
f"{name}_plot" : wandb.Image(plt)
}
)
Can someone help me? It is possible that I have an issue not understanding plt correctly…