Tag Archives: Climb the pit

ConnectionResetError: [Errno 104] Connection reset by peer

The fetch_MLdata function cannot download the MNIST dataset problem

from sklearn.datasets import fetch_mldata
mnist = fetch_mldata('MNIST original')


solution
1. Download the data set

!wget https://github.com/amplab/datascience-sp14/raw/master/lab7/mldata/mnist-original.mat


2. View the SkLearn data root directory

from sklearn.datasets.base import get_data_home 
print (get_data_home())

!tree /root/scikit_learn_data


3. Copy the data set to mldata directory

!cp mnist-original.mat /root/scikit_learn_data/mldata
!tree /root/scikit_learn_data


4. Verify

from sklearn.datasets import fetch_mldata
mnist = fetch_mldata('MNIST original')

mnist


5. OK!!!

mnist.data.shape

mnist.target.shape


added

from sklearn.datasets import fetch_openml	
mnist = fetch_openml('mnist_784', version=1)

can’t download it!

from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("./data/")

VIDEOIO ERROR: V4L: can’t open camera by index 0

1, problem description: using opencv to call the raspberry PI camera [cv2.videocapture (0)], when running the program, said can not open the camera.


2. Solution:

I looked for a method on the Internet, said to change 0 to -1, I changed, after the change, the system still said can not find the camera, let alone open.

and then I’m going to do the camera test and say

https://www.raspber rypi.org/documentation/configuration/camera.md

raspistill -v -o test.jpg

found that raspberry PI can take photos normally, indicating that there is no problem with the installation interface.

and search on the Internet, said to run the program to enter the following statement, that is, the raspberry PI system’s camera is ok, but opencv can not call. It can be called using this statement.

sudo modprobe bcm2835-v4l2

yes, the camera can be turned on after you type in this statement, but the screen will be bar by bar, for whatever reason, that’s not settled yet. Is the refresh too fast?

###############################################

https://blog.csdn.net/u012005313/article/details/70244747#C0, that’s a great blog

raspberry PI can call the camera and show the stripe instead of the original image, because the following two parameters mess up, comment out, it will work properly

# Set camera resolution
camera.set(cv2.cap_prop_frame_width, 620)
camera.set(cv2.cap_prop_frame_height, 480)