pengfeim / fatigue-driven-detection-based-on-cnn Goto Github PK
View Code? Open in Web Editor NEW本科毕设内容:基于卷积神经网络的疲劳驾驶检测。
本科毕设内容:基于卷积神经网络的疲劳驾驶检测。
Traceback (most recent call last):
File "D:/Users/admin computer/PycharmProjects/Fatigue-Driven-Detection-Based-on-CNN-master/camera_detection.py", line 82, in
torch.cat([o.view(-1,4) for o in priors],0)
File "D:\Users\anaconda3\envs\tf21\lib\site-packages\torch\autograd\function.py", line 160, in call
"Legacy autograd function with non-static forward method is deprecated. "
RuntimeError: Legacy autograd function with non-static forward method is deprecated. Please use new-style autograd function with static forward method. (Example: https://pytorch.org/docs/stable/autograd.html#torch.autograd.Function)
在camera_detection.py中Detect函数实例化为detect,然后使用的时候出错。
查了一下原因如下:由于你当前的pytorch版本过高,而原代码的版本较低。如果pytorch版本高于1.3会出现该问题。当前版本要求forward过程是静态的,所以需要将原代码进行修改。我pytorch版本为1.7.1,要降版本还要重装cuda非常麻烦。可以问一下是否有办法通过改代码解决呢?照网上的方法改不成功
大佬能把网络权重文件分享一下嘛?
如题
default_dtype() and torch.set_default_device() as alternatives. (Triggered internally at ..\torch\csrc\tensor\python_tensor.cpp:453.)
_C._set_default_tensor_type(t)
Traceback (most recent call last):
File "c:\Users\Lenovo\Desktop\Fatigue-Driven-Detection-Based-on-CNN-master\Train.py", line 111, in
train()
File "c:\Users\Lenovo\Desktop\Fatigue-Driven-Detection-Based-on-CNN-master\Train.py", line 84, in train
for step,(img,target) in enumerate(data_loader):
File "C:\Users\Lenovo\AppData\Roaming\Python\Python310\site-packages\torch\utils\data\dataloader.py", line 630, in next
data = self._next_data()
File "C:\Users\Lenovo\AppData\Roaming\Python\Python310\site-packages\torch\utils\data\dataloader.py", line 674, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "C:\Users\Lenovo\AppData\Roaming\Python\Python310\site-packages\torch\utils\data_utils\fetch.py", line 51, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "C:\Users\Lenovo\AppData\Roaming\Python\Python310\site-packages\torch\utils\data_utils\fetch.py", line 51, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "c:\Users\Lenovo\Desktop\Fatigue-Driven-Detection-Based-on-CNN-master\voc0712.py", line 111, in getitem
im, gt, h, w = self.pull_item(index)
File "c:\Users\Lenovo\Desktop\Fatigue-Driven-Detection-Based-on-CNN-master\voc0712.py", line 130, in pull_item
img, boxes, labels = self.transform(img, target[:, :4], target[:, 4])
File "c:\Users\Lenovo\Desktop\Fatigue-Driven-Detection-Based-on-CNN-master\augmentations.py", line 416, in call
return self.augment(img, boxes, labels)
File "c:\Users\Lenovo\Desktop\Fatigue-Driven-Detection-Based-on-CNN-master\augmentations.py", line 51, in call
img, boxes, labels = t(img, boxes, labels)
File "c:\Users\Lenovo\Desktop\Fatigue-Driven-Detection-Based-on-CNN-master\augmentations.py", line 237, in call
mode = random.choice(self.sample_options)
File "numpy\random\mtrand.pyx", line 936, in numpy.random.mtrand.RandomState.choice
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (6,) + inhomogeneous part.
时隔这么长时间来打扰实在不好意思,但是还是想冒昧问一下:
这个数据集是自己采集的吗?
还是
从哪里获取的呢?
你好!你的这个代码必须在有英伟达显卡的电脑上跑吗?我的电脑是mac,显卡是AMD的,不支持CUDA,能跑吗?
请问error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'运行Test的时候为什么会有这个错误呢。路径里没有中文。
关于准确率与召回率的添加字段是需要我自主添加,还是可以引用代码中已经写好,但未展示的呢?
您好
我在尝试微调网络的过程中发现在Test.py
中使用ssd_voc_5000.pth
配置文件的过程中会出现模型不匹配的报错信息,即
size mismatch for module.feature_map_conf_1.0.weight:
copying a param with shape torch.Size([12, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([16, 512, 3, 3]).
我注意到,您在Test.py
中本来使用了ssd_voc_5000_plus.pth
这一配置,但通过您所列举的渠道无法获得,请问这一问题可以如何解决呢
感谢
您好!如果方便的话可以分享一下相关论文和参考资料吗。想完善一下自己的论文和代码!谢谢!
我的邮箱是[email protected]
非常感谢
作者大大,请问camera模块可以不用吗,只想单纯的用数据集做检测可以吗,还有方便留一个联系方式吗,您的邮箱可能失效了
权重文件在哪下载呀?
大佬,数据集是怎么用的呀
可否在readme,md 中详细写一下,想学习一下
请问作者能不能方便提供一下视频检测的相关论文(不包括摄像头)呢
学长/学姐您好😄我正在做疲劳驾驶的大创项目,对于模型不太懂,所以下载了您的模型想自己跑一跑试试看。但是现在环境有些问题,我看到您标注了python是3.7,pytorch是1.0.1,那么您的numpy是什么版本?cuda是什么版本呢?目前cuda我已经装了三个版本,都是不匹配,numpy中的包也有问题,也正在挨个降级尝试。如果您能看到,希望您可以告知我这些包的版本,谢谢您啦🙇👼❤
运行eval.py的时候,报错如下:
TypeError: forward() missing 5 required positional arguments: 'prior_data', 'num_classes', 'top_k', 'conf_thresh', and 'nms_thresh'
请问如何解决报错
是运行test.py出来的吗
您好,想了解一下这项研究有论文发表吗?
博主你好,我的电脑在运行程序时普遍出现了cuda不可用问题,再不安装cuda的情况下可以用别的方式统一解决这个问题吗
兄弟,能方便价格qq吗?想向你咨询一点问题,有偿!!
大佬可以分享一下论文吗,我的邮箱是 [email protected],非常感谢您!
安装cv2失败了,报错ModuleNotFoundError: No module named 'cv2',在conda安装cv2报了一堆错。
(pythorch1.3版本以上的可能会因为版本太新的问题出错:RuntimeError: Legacy autograd function with non-static forward method is deprecated. Please use new-style autograd function with static forward method. )
帖主已经将detection、test等部分代码做了修改,可适应新版本pytorch,但我下载修改后的代码仍然会出上面的错误,请问有没有小伙伴同样出现了这样的问题,我在csdn,百度等网站搜索了一天,也没有解决这个问题,请问诸位有好的解决办法吗?
我的运行环境:python 3.7.0,cuda 11.3.1,cudnn 8.2.1,pytorch 1.11.0
初学者,原理的地方没看懂,请问 怎么得出眼睛和嘴部开闭状态的?
如果想要改用更高版本的pytorch,需要修改哪里的代码呢?服务器的cuda版本太高,不支持1.0的pytorch了。
这个文件是手动添加吗 要用哪个测试数据?
if (perclos > 0.4 or perblink < 0.25 or peryawn > 5 / 60):
print('疲劳')
# if(blink_freq<0.25)
else:
print('清醒')
通常情况下,当人疲劳时,平均眨眼百分比会增加。因为在疲劳状态下,眨眼的频率通常会增加,这是人体一种应对疲劳的自然反应。
不应该是perlink大于0.25吗,越困眨眼次数越多,perlink越大
请问可以分享一下论文吗
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.