TypeError: __init__() takes exactly 2 arguments (3 given) when I try to permute

TypeError: __init__() takes exactly 2 arguments (3 given) when I try to permute

在下面的示例中,我该如何正确排列行和列?

input_shape = (input_dim, input_features)
inputs = Input(input_shape)
net = Reshape(input_shape + (1, ), input_shape=input_shape)(inputs)

net 传递给 Conv2D。

当我使用 inpute_shape = Permute(2,1) 时出现错误 __init__() takes exactly 2 arguments (3 given)

谢谢!

这是我尝试了一些选项后最近的回溯:

Traceback (most recent call last):
  File "app.py", line 372, in <module>
    train(model_filename=args.model, epochs=args.epochs, dim=args.dim)
  File "app.py", line 61, in train
    output_classes=reader.CLASSES)
  File "/home/ubuntu/calypso_v2/model.py", line 53, in build_model
    net = Permute(3,2)(net)
TypeError: __init__() takes exactly 2 arguments (3 given)

Permute() 将元组作为其唯一的位置参数。您指定了两个整数 21.

而不是元组 (2,1)

试试这个:

inpute_shape = Permute((2,1))

答案是

net = Permute((2,1,3))(net)