Plot graphs through callback for ULMFiT Model


(Uttam) #1

Unable to plot the graphs through callback functions for ULMFiT

I am trying to plot with LossRecorder callback function , I have a GPU Instance with CUDA 9 version and a pytorch of version 0.4. But was unable to save the graph plots .

lrs = np.array([lr / (lrm ** 4), lr / (lrm ** 3), lr / (lrm ** 2), lr / lrm, lr])

m = get_rnn_classifier(bptt, 20 * 70, c, vs, emb_sz=em_sz, n_hid=nh, n_layers=nl, pad_token=1,
                               layers=[em_sz * 3, 50, c], drops=[dps[4], 0.1],
                               dropouti=dps[0], wdrop=dps[1], dropoute=dps[2], dropouth=dps[3])
        text_model = TextModel(to_gpu(m))
        learn = RNN_Learner(md, text_model, opt_fn=opt_fn)
        learn.reg_fn = partial(seq2seq_reg, alpha=2, beta=1)
        

learn.fit(lrs, n_cycles, wds=wd, cycle_len=cl, use_clr=(8, 8) if use_clr else None,
                  callbacks=[tb_logger, LoggingCallback(os.path.join(dir_path, 'logger')),LossRecorder(LayerOptimizer(opt_fn, text_model.get_layer_groups(), lrs, wds=None),save_path=os.path.join(dir_path, 'plots'))])

There is no particular error thrown but the following message in seen.

Unable to create graph.
%48 : Dynamic = onnx::Shape(%27)
 has empty scope name