import torch
import torch.nn as nn
import matplotlib.pyplot as plt
import numpy as np

Lr_G = 0.0001
Lr_D = 0.0001

G = nn.Sequential(
    nn.Linear(100, 128 * 6 * 6),
    nn.ReLU(),
    nn.UpsamplingBilinear2d(),
    nn.Conv2d(in_channels=1, out_channels=128, kernel_size=4),
    nn.ReLU(),
    nn.UpsamplingBilinear2d(),
    nn.Conv2d(in_channels=128, out_channels=64, kernel_size=4),
    nn.ReLU(),
    nn.Conv2d(in_channels=64, out_channels=3, kernel_size=4),
    nn.Tanh()
)
n = np.random.rand(100)
n = torch.tensor(n)
n = n.long()
print(n.type())
n = G(n)
print(n)


image.png1387×553 47.8 KB

i want to see output, just give a input ,but code broke down ,i wanna know why plz