how to solve the values changed when converting a pytorch Variable to numpy?
I am trying to convert a parameter of resnet34 to numpy , but I found that the values would change after converting, as shown in the figure.
Why would this happen? What can I do to get precise values in numpy format?
enter image description here

( I am trying to get parameter in torch pretrained models and put them in tensorflow 1.x model , since I can’t find a pretrained resnet34 models in tensorflow1 afteing searching for several days. I am afraid this changed of values would affect the accuracy of the model. )

(BTW, is there someway to download tensorflow1.x resnet34 pretrained modles with basic block instead of bottleneck block? 
I have searched in github for several days but failed to find one. I hate tensorflow.)

The values are not changed, they are identical, but PyTorch limits the default output to 4 decimal places (which gets rounded) to make it easier to inspect.

You can change that behaviour with torch.set_printoptions to show more decimal places.

value = torch.tensor(0.0052872747)

print(value) # =&gt; tensor(0.0053)

# Show 10 decimal places
torch.set_printoptions(precision=10)

print(value) # =&gt; tensor(0.0052872747)

