X2Paddle icon indicating copy to clipboard operation
X2Paddle copied to clipboard

TensorFlow转paddle出错:AttributeError: module 'convert' has no attribute '_get_parser'

Open 1chang37 opened this issue 2 years ago • 3 comments

在进行TensorFlow 转换paddle时遇到的错误 平台信息: paddlepaddle: 2.2.0 ubuntu 18.04

代码内容 co.py import convert as convert import argparse #parser = convert._get_parser() parser = convert._get_parser() parser.meta_file = "checkpoint/model.meta" parser.ckpt_dir = "checkpoint" parser.in_nodes = ["inputs"] parser.input_shape = ["None,224,224,3"] parser.output_nodes = ["vgg_16/fc8/squeezed"] parser.use_cuda = "True" parser.input_format = "NHWC" parser.save_dir = "paddle_model"

convert.run(parser)

错误信息: X2Paddle/tf/ckpt/16# python3 co.py Traceback (most recent call last): File "co.py", line 4, in parser = convert._get_parser() AttributeError: module 'convert' has no attribute '_get_parser'

1chang37 avatar May 06 '22 03:05 1chang37

@1chang37 可以将TF模型先导出成pb模型之后,在用下列命令进行转换

x2paddle --framework=tensorflow --model=tf_model.pb --save_dir=pd_model

wjj19950828 avatar May 06 '22 16:05 wjj19950828

@1chang37 可以将TF模型先导出成pb模型之后,在用下列命令进行转换

x2paddle --framework=tensorflow --model=tf_model.pb --save_dir=pd_model

没有GPU的化,如何cpu进行转化?

1chang37 avatar May 09 '22 07:05 1chang37

@1chang37 这个与环境无关,cpu、gpu都可以转

wjj19950828 avatar May 09 '22 08:05 wjj19950828