SRGAN转为.pb
The source address: https://github.com/tensorlayer/srgan I want to convert part of the get_G network in model.py to a.pb file.I didn't use the pre-training model,direct use model to.pb file.but, AttributeError: module 'tensorflow.python.framework.ops' has no attribute '_TensorLike'.I'm not familiar with tensorlayer code,plase help me . my code(to .pb file) G = get_G() input_signature=tf.TensorSpec([1,128,128,3]) output_tensor=G.infer.get_concrete_function(x=input_signature) frozen_func = convert_variables_to_constants_v2(output_tensor) frozen_func.graph.as_graph_def() pb_dir = r'srgan.pb' tf.io.write_graph(graph_or_graph_def=frozen_func.graph,logdir="models/pb",name=pb_dir,as_text=False) print('done')
Source: tensorlayer/TensorLayer