20230802

 终端时间显示,n中断时间显示

2023-08-02 21:07:55
2023-08-02 21:07:56
2023-08-02 21:07:57
2023-08-02 21:07:58
n
child=n  end!!!!!!!!!!
ubuntu@ubuntu:D5$ cat k3.c
#include <head.h>

void gettime();
void gettime()
{
	time_t t1;
	time(&t1);
	struct tm* info = localtime(&t1);

	printf("%4d-%02d-%02d %02d:%02d:%02d\n",\
			info->tm_year+1900,info->tm_mon+1,info->tm_mday,\
			info->tm_hour,info->tm_min,info->tm_sec);
}

int main()
{
	char s1;
	pid_t cpid = fork();
	if(cpid > 0)
	{
		while(1)
		{
			sleep(1);
			pid_t c1 = waitpid(-1,NULL,WNOHANG);
			if(c1 > 0)
			{
				return 0;
			}
			else
			{
				gettime();
			}
		}

	} 
	else if(0 == cpid)
	{
		while(1)
		{
			scanf("%s",&s1);
			printf("child=%s  ",&s1);
			if(s1 == 'n')
			{
				printf("end!!!!!!!!!!\n");
				exit(0);
			}
		}

	}
	else
	{
		perror("fork");
		return -1;
	}


	return 0;

}

守护进程

#include <head.h>

int main()
{
	pid_t cpid = fork();

	if(0 == cpid)
	{
		pid_t sid = setsid();
		printf("%d",sid);

		chdir("/");

		umask(0);

		for(int i=0;i<getdtablesize();i++)
			close(i);

		while(1)
		{
		sleep(1);
		}
	}

	return 0;
}

 

Fusing layers... Model Summary: 140 layers, 7.45958e+06 parameters, 0 gradients Traceback (most recent call last): File "E:\YOLO5_20230802\YOLO5\yolov5-master\detect.py", line 170, in <module> detect() File "E:\YOLO5_20230802\YOLO5\yolov5-master\detect.py", line 63, in detect _ = model(img.half() if half else img) if device.type != 'cpu' else None # run once File "C:\Users\admin1\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "E:\YOLO5_20230802\YOLO5\yolov5-master\models\yolo.py", line 115, in forward return self.forward_once(x, profile) # single-scale inference, train File "E:\YOLO5_20230802\YOLO5\yolov5-master\models\yolo.py", line 135, in forward_once x = m(x) # run File "C:\Users\admin1\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "E:\YOLO5_20230802\YOLO5\yolov5-master\models\common.py", line 89, in forward return self.conv(torch.cat([x[..., ::2, ::2], x[..., 1::2, ::2], x[..., ::2, 1::2], x[..., 1::2, 1::2]], 1)) File "C:\Users\admin1\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "E:\YOLO5_20230802\YOLO5\yolov5-master\models\common.py", line 33, in fuseforward return self.act(self.conv(x)) File "C:\Users\admin1\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "C:\Users\admin1\anaconda3\lib\site-packages\torch\nn\modules\activation.py", line 461, in forward return F.hardswish(input, self.inplace) File "C:\Users\admin1\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 1177, in __getattr__ raise AttributeError("'{}' object has no attribute '{}'".format( AttributeError: 'Hardswish' object has no attribute 'inplace' python-BaseException Backend qt5agg is interactive backend. Turning interactive mode on.
06-30
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值