How can I solve this error ?
import matplotlib, cv2
import numpy as np
import matplotlib.pyplot as plt
img = cv2.imread('C:/Users/xxx/Desktop/image.jpg')
img = np.array(img, dtype=np.uint8)
plt.imshow(cv2.cvtColor(img, cv2.COLOR_GRAY2RGB))
error: OpenCV(4.0.0) c:\projects\opencv-python\opencv\modules\imgproc\src\color.hpp:259: error: (-2:Unspecified error) in function '__cdecl cv::CvtHelper,struct cv::Set<3,4,-1>,struct cv::Set<0,2,5>,2>::CvtHelper(const class cv::_InputArray &,const class cv::_OutputArray &,int)'
Invalid number of channels in input image: 'VScn::contains(scn)' where 'scn' is 3