Skip to content

RuntimeError using SubpixelConv1d: SubpixelConv1d._PS is a private method #1024

@Rafagd

Description

@Rafagd

New Issue Checklist

Issue Description

The SubpixelConv1d class decorates the method _PS as @private_method, but when its own forward method calls the _PS function, the decorator for some reason gets confused and can't detect it's a valid use of the method and raises the exception.

Reproducible Code

  • Debian Gnu/Linux (testing/bulleye)
  • Please provide a reproducible code of your issue. Without any reproducible code, you will probably not receive any help.
#!/usr/bin/python3

import tensorflow as tf
import tensorlayer as tl
import numpy as np

inputs = tl.layers.Input((1, 2, 2))
prev   = tl.layers.SubpixelConv1d(2, in_channels=2)(inputs)
model = tl.models.Model(inputs, prev)

train_batch = np.array([1, 2, 3, 4])
train_batch = train_batch.reshape((1,2,2))
valid_batch = train_batch

tl.utils.fit(model,
    train_op=tf.optimizers.Adam(learning_rate=0.0001),
    cost=tl.cost.cross_entropy,
    X_train=train_batch, y_train=train_batch,
    acc=tf.compat.v1.metrics.accuracy, batch_size=len(train_batch), n_epoch=20, X_val=valid_batch, y_val=valid_batch, eval_train=True,
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions