So i finally found a solution to this. Maybe it is because there is another problem but if I detach the data point weights w_dp after do_reweighting(w_dp) there I don’t get the error when training the second model using the new data point weights.
    w_dp = rboost_nn.do_reweighting(w_dp) 
    w_dp.detach()