net.forward() 报错

问题遇到的现象和发生背景

使用素材: https://github.com/PJ-Finlay/Neural-Style-Transfer-Images/

问题相关代码,请勿粘贴截图 ?%ra=card

from tracemalloc import start
import cv2
import matplotlib.pylab as pylab
import imutils
import time
import numpy as np

net.forward() 报错
python
opencv
问题遇到的现象和发生背景
使用素材: https://github.com/PJ-Finlay/Neural-Style-Transfer-Images/

问题相关代码,请勿粘贴截图 ?%ra=card
from tracemalloc import start
import cv2
import matplotlib.pylab as pylab
import imutils
import time
import numpy as np

model = 'neural-style-transfer/models/eccv16/starry_night.t7'

assumes the pre-trained torch file is in the current path

model = './neural-style-transfer/starry_night.t7'
print("loading style transfer nodel...")
net = cv2.dnn.readNetFromTorch(model)

image = cv2.imread('./images/monalisa.jpg') # the current image path

image = cv2.imread('./neural-style-transfer/Images/originals/three_beauties_of_the_present_time.jpeg')

image = cv2.imread('F:/ImageProcessing/Chapter11/neural-style-transfer/Images/getty.jpg')

pylab.imshow(image)
image = imutils.resize(image, width=600)
(h, w) = image.shape[:2]
b, g, r = np.mean(image[...,0]), np.mean(image[...,1]), np.mean(image[...,2])

construct a blob from the image, set the input, and then perform a forward pass of the network

blob = cv2.dnn.blobFromImages(image, 1.0, (w,h), (b,g,r), swapRB=False, crop=False)
net.setInput(blob)
start = time.time()
output = net.forward()
end = time.time()

运行结果及报错内容

error Traceback (most recent call last)
f:\ImageProcessing\Chapter11\Chapter11.ipynb Cell 21 in <cell line: 27>()
25 net.setInput(blob)
26 start = time.time()
---> 27 output = net.forward()
28 end = time.time()

error: OpenCV(4.6.0) d:\a\opencv-python\opencv-python\opencv\modules\dnn\src\layer_internals.hpp:110: error: (-2:Unspecified error) Can't create layer "l1_NoiseFill" of type "NoiseFill" in function 'cv::dnn::dnn4_v20220524::detail::LayerData::getLayerInstance'

我的解答思路和尝试过的方法

更换图片,更新OpenCV版本,均未解决!

我想要达到的结果

跑通代码,并理解报错原因!