我有一台笔记本电脑,配置如下
Processor : AMD Ryzen 7 4800H with Radeon Graphics 2.90 GHz
Installed RAM : 16.0 GB (15.4 GB usable)
Windows Edition : Windows 11 Home Single Language
Version : 22H2
OS : 22621.1555
NVIDIA GTX GEFORCE 1650 GRAPHICS CARD
NVIDIA DRIVER : 31.0.15.3161
这是一台全新的笔记本电脑,安装了以下Python和CUDA:
Python 3.10.11
---------------------------------------------------------------------------------------+
| NVIDIA-SMI 531.61 Driver Version: 531.61 CUDA Version: 12.1 |
|-----------------------------------------+----------------------+----------------------+
| GPU Name TCC/WDDM | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+======================+======================|
| 0 NVIDIA GeForce GTX 1650 WDDM | 00000000:01:00.0 Off | N/A |
| N/A 44C P0 15W / N/A| 0MiB / 4096MiB | 0% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
+---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| No running processes found |
+---------------------------------------------------------------------------------------+
但是,每当我尝试运行我的YOLOV8模型进行对象检测时,它只在第一个epoch期间关闭。不知道为什么会发生。任何帮助是高度赞赏。
我的Python代码
import tensorflow as tf
from ultralytics import YOLO
print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU')))
print(tf.test.is_built_with_cuda())
print(tf.config.list_physical_devices('GPU'))
# Create a TensorFlow session with GPU growth enabled
config = tf.compat.v1.ConfigProto()
config.gpu_options.allow_growth = True
sess = tf.compat.v1.Session(config=config)
physical_devices = tf.config.list_physical_devices('GPU')
tf.config.experimental.set_memory_growth(physical_devices[0], True)
print(tf.test.is_built_with_cuda())
# Run your code in the session
with sess.as_default():
# Load the model.
model = YOLO('yolov8n.pt')
# Training.
results = model.train(
data='data.yaml',
imgsz=640,
epochs=5,
batch=8,
name='yolov8n_custom')
PS我还想知道YOLOV8的硬件要求是什么
1条答案
按热度按时间n3ipq98p1#
正如你提到的,你的笔记本电脑的显卡是GTX1650,它只有4GB的图形内存。您可以尝试将代码中的批处理设置为4,2或1,因为我的显卡是3060,它有6GB的内存。当我将批处理设置为8时,我也将报告错误