nn-transfer
nn-transfer copied to clipboard
Convert trained PyTorch models to Keras, and the other way around
**Is it suitable for one-dimensional models? I want to convert a one-dimensional model,but there is a bug that I can’t handle. here is my models,I really hope to get help....
I'm having issues in transferring models with batchnorm layers from pytorch to keras. Other way round works perfectly fine. Any thoughts? Appreciate the help! Here are the two architectures I...
Probably related to issue #8. Running the code in the notebook example.ipynb showed differences between the keras and pytorch model. The issue is that the Keras Flatten function does a...
Hello guido The first I would like to know is that since fast.ai is built on the pytorch framework, can we convert a model built on fast.ai into keras using...
the "view" in pytorch and "flatten" in keras work differently. To fix this problem add this layer before "Flatten": `x = Lambda(lambda x: K.permute_dimensions(x, (0, 3, 1, 2)))(x)`
I try to convert this model ``` class net_pytorch(torch.nn.Module): def __init__(self,Nin=6,Nout=1,Nlinear=112*60): super(vel_regressor, self).__init__() self.model1 = torch.nn.Sequential( torch.nn.Conv1d(Nin,60,kernel_size=3,stride=1,groups=Nin), torch.nn.ReLU(), torch.nn.Conv1d(60,120,kernel_size=3,stride=1,groups=Nin), torch.nn.ReLU(), torch.nn.Conv1d(120,240,kernel_size=3,stride=1), torch.nn.ReLU(), torch.nn.MaxPool1d(10, stride=6), ) self.model2=model2=torch.nn.Sequential( torch.nn.Linear(Nlinear, 10*40), torch.nn.ReLU(), torch.nn.Linear(10*40,...
Hi Guido, it looks like all Keras->Pytorch examples provided with the package are for the case of "channels_first" image data format. I have been struggling to make it work for...
Install torch,torchvision,tensorflow in virtualenv. with **python setup.py test** I get below error ERROR: test_batch_normalization (nn_transfer.test.test_layers.TestLayers) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/****/nn-transfer/nn_transfer/test/test_layers.py", line 87, in test_batch_normalization keras_model, pytorch_model, self.test_data,...
@gzuidhof You are the boss! Great project, saved me days, honestly! Meanwhile, if I have time, temp.h5 has to be cleaned up, after execution.