Open Zoeeeeey opened 4 months ago
您好,在paddle 2.6.1下是否还支持使用cinn?
paddle 2.6.1
当调用paddle.cinn.enable_cinn_compiler()时,出现报错AttributeError: module 'paddle' has no attribute 'cinn'。
paddle.cinn.enable_cinn_compiler()
AttributeError: module 'paddle' has no attribute 'cinn'
以下这段代码可以复现这个问题。
import paddle from paddle.static import InputSpec paddle.enable_static() paddle.cinn.enable_cinn_compiler() def create_model(): x = paddle.static.data(name='x', shape=[None, 32, 32, 3], dtype='float32') conv2d = paddle.static.nn.conv2d(input=x, num_filters=6, filter_size=3, stride=2, padding=1) pool2d = paddle.static.nn.max_pool2d(input=conv2d, kernel_size=2, stride=2) return pool2d paddle_model = paddle.static.Program() startup_program = paddle.static.Program() with paddle.static.program_guard(paddle_model, startup_program): model = create_model() exe = paddle.static.Executor(paddle.CPUPlace()) exe.run(startup_program) x = paddle.randn([1, 32, 32, 3], dtype='float32') result = exe.run(paddle_model, feed={'x': x.numpy()}, fetch_list=[model]) print(result)
得到的输出:
Traceback (most recent call last): File "xxx.py", line 6, in <module> paddle.cinn.enable_cinn_compiler() AttributeError: module 'paddle' has no attribute 'cinn'
No response
可通过paddle.jit.to_static接口的backend参数指定,参考文档(https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/jit/to_static_cn.html#to-static)。
paddle.jit.to_static
backend
bug描述 Describe the Bug
您好,在
paddle 2.6.1
下是否还支持使用cinn?当调用
paddle.cinn.enable_cinn_compiler()
时,出现报错AttributeError: module 'paddle' has no attribute 'cinn'
。以下这段代码可以复现这个问题。
得到的输出:
其他补充信息 Additional Supplementary Information
No response