我正在尝试使用torch.nn.utils.prune提供 2 个张量的PyTorch 修剪我的模型,
我已经尝试了两种解决方案,但都没有提高推理速度:
有没有办法用模型张量和掩码来提高速度?与 0 的非零浮点数相乘不会比将 2 个浮点数相乘快吗?
这是我的修剪函数和修剪速度计算程序:
def prune_net(net):
"""Prune 20% net's weights that have abs(value) approx. 0
Function that will be use when an iteration is reach
Args:
Return:
newnet (nn.Module): a newnet contain mask that help prune network's weight
"""
if not isinstance(net,nn.Module):
print('Invalid input. Must be nn.Module')
return
newnet = copy.copy(net)
modules_list = []
for name, module in newnet.named_modules():
if isinstance(module, …Run Code Online (Sandbox Code Playgroud) 我正在使用 vlc 读取 rtsp 流,如下所示:
rtsp://username:password@!@192.168.1.108:15667/cam/realmonitor?channel=30&subtype=0
Run Code Online (Sandbox Code Playgroud)
用户名是“username”,密码是“password@!”
当我检查消息时,VLC 似乎无法正确读取链接。我的VLC版本是3.0.8。
有没有办法让 VLC 读取提供的流?