Home > other >  SRCNN characteristics graph visualization solution
SRCNN characteristics graph visualization solution

Time:10-29

Conv1=tf. Nn. Relu (tf) nn) conv2d (images, weights [' w1], strides=,1,1,1 [1], the padding=padding) + biases [' b1 '])
Conv2=tf. Nn. Relu (tf) nn) conv2d (conv1, weights [' w2], strides=,1,1,1 [1], the padding=padding) + biases [' b2])
Conv3=tf. Nn. Conv2d (conv2, weights [' w3], strides=,1,1,1 [1], the padding=padding) + biases [' b3]


Saver=tf. Train. Saver ()
Pred1=conv1
Mr Pred=conv3
With tf. The Session () as sess:
CKPT=tf. Train. Get_checkpoint_state (" checkpoint ")
If CKPT and CKPT. Model_checkpoint_path: # load saved model
Saver. Restore (sess, CKPT. Model_checkpoint_path)
# img1=(weights) [r]. 'w1 eval ()) # check to see if the convolution kernels in change
Pred2=pred1. Eval ({images: train_data, labels: train_label})
The split=tf. The split (pred2, pred2 shape [1], the axis=3)
Print (len (STR))
For I in range (64) :
Img1=split [I]
IO. Imsave (r './data/{}. The PNG ', the format (I), img1)
Result=Mr Pred. Eval ({images: train_data, labels: train_label}) # after training results

The above is part of the code

One of the first layer of output 64 images saved in the specified folder, want to ask, how to change the following code:
For I in range (64) :
Img1=split [I]
IO. Imsave (r './data/{}. The PNG ', the format (I), img1)

Error: the Traceback (most recent call last) :
The File "step 3 - test. Py, line 86, in & lt; module>
IO. Imsave (r './data/{}. The PNG ', the format (I), img1)
The File "python3.7/site - packages/skimage/IO/_io py", line 129, in imsave
If arr. Dtype==bool:
AttributeError: 'STR' object has no attribute 'dtype'



Thanks for your bosses!


CodePudding user response:

The split of the output is so want to put it into image save

nullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related