Hi,
I am using pytorch in my research about adversary machine learning. I am writing a code using inceptionV3 network. I am trying to get the input for the first layer(list(model.children())[0]), which the input should have 3 channel. The structure of the network is showed below:
(See figure 1)
However when I add hook in this layer, shows below in the deal_inception method, I can only get input information of one channel.
(See figure 2)
The first layer and output of the model is showed below:
(See figure 3)
From the size of the inputs which returned by the hook(get_hook method), it is as the following:
(See figure 4)
From the code showed before, the ‘inputs’ is the list where hook function store the input in, and this list only contain one element since we only inference one image in to the network. The inputs[0].shape should be (3,32,127,127), but it turns out (1,32,127,127) instead, it looks like only one channel input information or hooked.
Could you tell me where the other two is, and how to revise my code to get the whole input about the first layer? Thanks.
082617462621_011951×3149 577 KB