Solved by ptrblck in post #11 
              
              
                features seems not to be detached, so could you call features = features.detach().cpu().numpy() before passing it to the svm?