We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I spent a lot of time and still couldn't solve this problem. Has anyone encountered this problem? Can you provide a solution? Thank you so much!
The content you are editing has changed. Please copy your edits and refresh the page.
import argparse
parser = argparse.ArgumentParser(description='Calculate volume of a cylinder') parser.add_argument("--rgb_max", default=1) parser.add_argument("--fp16", default=True) args = parser.parse_args() # 获取所有参数
flownet2 = FlowNet2(args=args)
first_module = flownet2.flownetc.conv1[0] # 假设 conv1 是一个包含一个子模块的 Sequential 对象
expected_channels = first_module.in_channels print("模型的期望输入通道数:", expected_channels)
batch_size = 1 channels = 3 height = 64 width = 64 inputs = torch.randn(batch_size, channels, height, width) # 随机生成一个输入张量
output = flownet2(inputs)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I spent a lot of time and still couldn't solve this problem. Has anyone encountered this problem? Can you provide a solution? Thank you so much!
Tasks
import argparse
parser = argparse.ArgumentParser(description='Calculate volume of a cylinder')
parser.add_argument("--rgb_max", default=1)
parser.add_argument("--fp16", default=True)
args = parser.parse_args() # 获取所有参数
flownet2 = FlowNet2(args=args)
获取 conv1 的第一个子模块
first_module = flownet2.flownetc.conv1[0] # 假设 conv1 是一个包含一个子模块的 Sequential 对象
获取第一个子模块的输入通道数
expected_channels = first_module.in_channels
print("模型的期望输入通道数:", expected_channels)
创建符合期望通道数的随机输入张量
batch_size = 1
channels = 3
height = 64
width = 64
inputs = torch.randn(batch_size, channels, height, width) # 随机生成一个输入张量
将输入张量传递给模型获取输出
output = flownet2(inputs)
The text was updated successfully, but these errors were encountered: