From f558d5c39cf57f04debc0baa18bdbf057d3a444f Mon Sep 17 00:00:00 2001
From: AlexeyAB <alexeyab84@gmail.com>
Date: Thu, 22 Feb 2018 20:16:36 +0000
Subject: [PATCH] Fix
---
src/network.c | 2 +-
src/convolutional_layer.c | 2 ++
src/http_stream.cpp | 6 +++---
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/convolutional_layer.c b/src/convolutional_layer.c
index 6865808..aeb621a 100644
--- a/src/convolutional_layer.c
+++ b/src/convolutional_layer.c
@@ -148,7 +148,9 @@
cudnnDataType_t data_type = CUDNN_DATA_FLOAT;
#endif
// Tensor Core uses CUDNN_TENSOR_OP_MATH instead of CUDNN_DEFAULT_MATH
+#if(CUDNN_MAJOR >= 7)
cudnnSetConvolutionMathType(l->convDesc, CUDNN_TENSOR_OP_MATH);
+#endif
// INT8_CONFIG, INT8_EXT_CONFIG, INT8x4_CONFIG and INT8x4_EXT_CONFIG are only supported
// on architectures with DP4A support (compute capability 6.1 and later).
diff --git a/src/http_stream.cpp b/src/http_stream.cpp
index 4392a27..abc9954 100644
--- a/src/http_stream.cpp
+++ b/src/http_stream.cpp
@@ -56,7 +56,7 @@
int timeout; // master sock timeout, shutdown after timeout millis.
int quality; // jpeg compression [1..100]
- int _write(int sock, char *s, int len)
+ int _write(int sock, char const*const s, int len)
{
if (len < 1) { len = strlen(s); }
return ::send(sock, s, len, 0);
@@ -128,7 +128,7 @@
params.push_back(IMWRITE_JPEG_QUALITY);
params.push_back(quality);
cv::imencode(".jpg", frame, outbuf, params);
- unsigned int outlen = outbuf.size();
+ size_t outlen = outbuf.size();
#ifdef _WIN32
for (unsigned i = 0; i<rread.fd_count; i++)
@@ -169,7 +169,7 @@
else // existing client, just stream pix
{
char head[400];
- sprintf(head, "--mjpegstream\r\nContent-Type: image/jpeg\r\nContent-Length: %lu\r\n\r\n", outlen);
+ sprintf(head, "--mjpegstream\r\nContent-Type: image/jpeg\r\nContent-Length: %zu\r\n\r\n", outlen);
_write(s, head, 0);
int n = _write(s, (char*)(&outbuf[0]), outlen);
//cerr << "known client " << s << " " << n << endl;
diff --git a/src/network.c b/src/network.c
index 10d1ead..c906b58 100644
--- a/src/network.c
+++ b/src/network.c
@@ -356,7 +356,7 @@
//fflush(stderr);
for (i = 0; i < net->n; ++i){
layer l = net->layers[i];
- printf(" %d: layer = %d,", i, l.type);
+ //printf(" %d: layer = %d,", i, l.type);
if(l.type == CONVOLUTIONAL){
resize_convolutional_layer(&l, w, h);
}else if(l.type == CROP){
--
Gitblit v1.10.0