Comments (11)
而且代码仅用self.cuda判断是有bug的,
比如self.cuda为True, 但机器如果没有gpu或torch是cpu版本的,执行过程就会有bug
from yolov4-pytorch.
1、代码的哪个地方
2、什么显示不出来
3、self.cuda只是为了判断是否用cuda,自由度更高,我在训练东西的时候我都可以把Cuda设置成False,这个时候我就能预测或者训练试试看代码是否正确。如果机器没有GPU却不知道设置CUDA的话,我觉得可能基础还要加强一下。
from yolov4-pytorch.
根目录yolo.py里Yolo类的代码。
from yolov4-pytorch.
class YOLO(object):
_defaults = {
"model_path": 'model_data/yolo4_weights.pth',
"anchors_path": 'model_data/yolo_anchors.txt',
"classes_path": 'model_data/coco_classes.txt',
"model_image_size" : (416, 416, 3),
"confidence": 0.5,
"cuda": True
}
@classmethod
def get_defaults(cls, n):
if n in cls._defaults:
return cls._defaults[n]
else:
return "Unrecognized attribute name '" + n + "'"
#---------------------------------------------------#
# 初始化YOLO
#---------------------------------------------------#
def __init__(self, **kwargs):
self.__dict__.update(self._defaults)
self.class_names = self._get_class()
self.anchors = self._get_anchors()
self.generate()
from yolov4-pytorch.
不是有吗
from yolov4-pytorch.
我明白你的意思,都在default里设置参数,像我第一问那样传参创建就没法用了
from yolov4-pytorch.
只是建议哈
from yolov4-pytorch.
没听太懂…不是在init的时候已经update过了吗
from yolov4-pytorch.
我意思是你固定死了参数,创建时传参怎么办,每次来yolo.py文件里改吗?算没没说哈😄
from yolov4-pytorch.
加上这个:self.dict.update(kwargs)
然后在实例的时候可以直接传参数就不用改代码了
yolo = YOLO({'model_path': 'model_data/yolo4_weights.pth',
'classes_path': 'model_data/coco_classes.txt'})
from yolov4-pytorch.
加上这个:self.dict.update(kwargs) 然后在实例的时候可以直接传参数就不用改代码了 yolo = YOLO({'model_path': 'model_data/yolo4_weights.pth',
'classes_path': 'model_data/coco_classes.txt'})
哎,,怎么字典前面的2个星号不显示。。
from yolov4-pytorch.
Related Issues (20)
- opencv加载图像进行推理 HOT 5
- train_loss下降正常,val_loss不变,map一直很低,实际预测检测效果很差。 HOT 2
- train_loss下降,val_loss不变,map一直不变,自建数据集预测效果很差。 HOT 9
- 验证损失低于训练损失 HOT 2
- 替换YOLOv4主干网络为ghost或者mobilenetv2/3,检测精度直接为0或者零点几? HOT 14
- 你好,想问下更改预测框的颜色字体粗细大小 要如何更改啊 HOT 3
- 找不到dropblock,SAF等方法的人看这里 HOT 1
- loss计算太慢 HOT 7
- get_map很低
- please help me,why are the images of the validation set used during the training process? HOT 1
- 1
- AP很低 HOT 2
- 导,你的heatmap生成原理是什么?
- 请求 HOT 1
- 求教predict和get_map中detect_image的区别
- 默认参数没有调整,loss一直是nan HOT 2
- 计算量怎么查看? HOT 1
- File "mtrand, pyx", line 934, in numpy.random. mtrand. RandomState. choiceValueError: a cannot be empty unless no samples are taken
- RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [4096]] is at version 3; expected version 2 instead. HOT 1
- 请问yolov4的预训练权重从哪下载呢 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yolov4-pytorch.