python出现 'numpy.dtype' object has no attribute 'is_floating'

模型进行训练的时候在优化器运行部分出现了 'numpy.dtype' object has no attribute 'is_floating'

<ipython-input-1-12256e71d6bc> in <module>
    260 print('\nPCC training')
    261 start = time.time()
--> 262 source_acc, target_acc = train_and_evaluate('pcc')
    263 sio.savemat('PCC1.mat',{'a':target_y})
    264 end = time.time()

<ipython-input-1-12256e71d6bc> in train_and_evaluate(training_mode, num_steps, verbose)
    221             y = np.vstack([y0, y1])
    222             pred_loss, coral_loss, cycle_loss, total_loss, classify_labels, pred= loss_function(Fmodel,X,y,True)
--> 223             pcc_train_op = tf.train.MomentumOptimizer(learning_rate, 0.9).minimize(lambda:total_loss)
    224             #Evaluation
    225             correct_label_pred = tf.equal(tf.argmax(classify_labels, 1),tf.argmax(pred_labels,1))

~/anaconda3/envs/alex/lib/python3.6/site-packages/tensorflow/python/training/optimizer.py in minimize(self, loss, global_step, var_list, gate_gradients, aggregation_method, colocate_gradients_with_ops, name, grad_loss)
    401         aggregation_method=aggregation_method,
    402         colocate_gradients_with_ops=colocate_gradients_with_ops,
--> 403         grad_loss=grad_loss)
    404 
    405     vars_with_grad = [v for g, v in grads_and_vars if g is not None]

~/anaconda3/envs/alex/lib/python3.6/site-packages/tensorflow/python/training/optimizer.py in compute_gradients(self, loss, var_list, gate_gradients, aggregation_method, colocate_gradients_with_ops, grad_loss)
    473       # to be executed.
    474       with ops.control_dependencies([loss_value]):
--> 475         grads = tape.gradient(loss_value, var_list, grad_loss)
    476       return list(zip(grads, var_list))
    477 

~/anaconda3/envs/alex/lib/python3.6/site-packages/tensorflow/python/eager/backprop.py in gradient(self, target, sources, output_gradients, unconnected_gradients)
    948     flat_targets = []
    949     for t in nest.flatten(target):
--> 950       if not t.dtype.is_floating:
    951         logging.vlog(
    952             logging.WARN, "The dtype of the target tensor must be "

AttributeError: 'numpy.dtype' object has no attribute 'is_floating'

一直解决不了

1个回答

is_float吧,写成了is_floating

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
fatal error: boost/python/numpy.hpp: No such file or directory
哪个大神能解决这个问题,感激不尽!!! ``` fatal error: boost/python/numpy.hpp: No such file or directory ```
numpy.ndarray' object has no attribute 'show'
已安装:matplotlib,pyparsing,numpy,scipy 源代码: #!/usr/bin/env python # -*- coding:utf-8 -*- from PIL import Image from pylab import* im=array(Image.open('c:\\Python27\\tiananmen.jpg')) im.show() x=[100,100,400,400] y=[200,500,200,500] plot(x,y,'r*') #使用红色星状标记绘制点 plot(x[:2],y[:2])#绘制连接前两个点的线 title('Plotting:"tiananmen.jpg"') #添加标题
Python用tar.gz文件安装时出现错误:No module named 'numpy.distutils._msvccompiler' in numpy.distutils及Unable to find vcvarsall.bat
系统win10 64位,python版本3.7.4。 在网上下载了scikit-learn-0.22.tar,解压后利用python setup.py install进行安装时报错。 代码如下: ``` PS C:\Users\TH.Liu> cd E:\python\Scripts\scikit-learn-0.22\scikit-learn-0.22 PS E:\python\Scripts\scikit-learn-0.22\scikit-learn-0.22> python setup.py install Partial import of sklearn during the build process. E:\python\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'project_urls' warnings.warn(msg) E:\python\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'python_requires' warnings.warn(msg) E:\python\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'install_requires' warnings.warn(msg) No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils Traceback (most recent call last): File "setup.py", line 303, in <module> setup_package() File "setup.py", line 299, in setup_package setup(**metadata) File "E:\python\lib\site-packages\numpy\distutils\core.py", line 137, in setup config = configuration() File "setup.py", line 182, in configuration config.add_subpackage('sklearn') File "E:\python\lib\site-packages\numpy\distutils\misc_util.py", line 1035, in add_subpackage caller_level = 2) File "E:\python\lib\site-packages\numpy\distutils\misc_util.py", line 1004, in get_subpackage caller_level = caller_level + 1) File "E:\python\lib\site-packages\numpy\distutils\misc_util.py", line 941, in _get_configuration_from_setup_py config = setup_module.configuration(*args) File "sklearn\setup.py", line 86, in configuration cythonize_extensions(top_path, config) File "E:\python\Scripts\scikit-learn-0.22\scikit-learn-0.22\sklearn\_build_utils\__init__.py", line 50, in cythonize_extensions basic_check_build() File "E:\python\Scripts\scikit-learn-0.22\scikit-learn-0.22\sklearn\_build_utils\pre_build_helpers.py", line 70, in basic_check_build compile_test_program(code) File "E:\python\Scripts\scikit-learn-0.22\scikit-learn-0.22\sklearn\_build_utils\pre_build_helpers.py", line 40, in compile_test_program extra_postargs=extra_postargs) File "E:\python\lib\distutils\_msvccompiler.py", line 346, in compile self.initialize() File "E:\python\lib\distutils\_msvccompiler.py", line 239, in initialize vc_env = _get_vc_env(plat_spec) File "E:\python\lib\distutils\_msvccompiler.py", line 135, in _get_vc_env raise DistutilsPlatformError("Unable to find vcvarsall.bat") distutils.errors.DistutilsPlatformError: Unable to find vcvarsall.bat ``` 实际上,这俩错误我都在网上找过许多解决方式,但都没有用。下载了VS2010并尝试过在cmd中设置VS90COMNTOOLS =%VS100COMNTOOLS%,依然无效。 抱着最后的希望来这里求助……希望能得到解决。 ———————————————————— 2019.12.17 更新: 在安装了VS2015之后,vcvarsall.bat的问题消失了,剩下的只有: ``` E:\python\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'project_urls' warnings.warn(msg) E:\python\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'python_requires' warnings.warn(msg) E:\python\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'install_requires' warnings.warn(msg) No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils ``` 这些问题了。 大家说PowerShell容易出BUG,我换用CMD后依旧如此。 我依旧没有找到这些报错的解决方案,希望得到大佬的帮助!
Windows下 sklearn:numpy.ufunc has the wrong size
各位大神求指点,我使用ArcGIS10.3自带的Python2.7.8(NumPy 1.7.1,matplotlib 1.3.0)自己去官网下载安装了scipy0.13.3和scikit-learn0.16.0,在编译scikit learn时出现numpy.dtype size问题,还没有运行其他代码,只是导入库就不行了: print('Hello World') # import numpy & scipy import numpy as np from numpy import linalg from numpy.linalg import norm from scipy.spatial.distance import squareform, pdist # import sklearn. import sklearn from sklearn.manifold import TSNE from sklearn.datasets import load_digits from sklearn.preprocessing import scale print "working" ![图片说明](https://img-ask.csdn.net/upload/201601/02/1451704594_425391.png) 新手跪求指点,万分感谢!
树莓派opencv错误AttributeError: 'cv2.face_LBPHFaceRecognizer' object has no attribute 'read'?
树莓派3B+上进行opencv人脸识别代码调试遇到错误AttributeError: 'cv2.face_LBPHFaceRecognizer' object has no attribute 'read' 以下是部分出错代码段: import cv2 import numpy as np import os recognizer = cv2.face.createLBPHFaceRecognizer() **recognizer.read('/home/pi/facechack/face_image/trainer/trainer.yml')** cascadePath = "/home/pi/facechack/haarcascades/haarcascade_frontalface_default.xml" faceCascade = cv2.CascadeClassifier(cascadePath); ``` ```
请教朋友们,python中numpy.min(dataset[:,j]) 这句话是什么意思?
各位大神好,问题是这样的: 最近在看K-means聚类算法的python实现版本,看到了一个朋友写的程序,下面是选取数据集dataSet的k个初始中心的函数 ``` 各位大神好,问题是这样的: 最近在看K-means聚类算法的python实现版本,看到了一个朋友写的程序,下面是选取数据集dataSet的k个初始中心的函数 18 def randCent(dataSet, k): 19 n = shape(dataSet)[1] 20 centroids = mat(zeros((k,n))) 21 for j in range(n): 22 minJ = min(dataSet[:,j]) 23 rangeJ = float(max(array(dataSet)[:,j]) - minJ) 24 centroids[:,j] = minJ + rangeJ * random.rand(k,1) 25 return centroids 其中第22行没看明白minJ = min(dataSet[:,j]) dataSet是一个mat类型的numpy矩阵。 dataSet[:,j] 是什么意思啊?请教各位朋友,十分感谢 ``` 其中第22行没看明白minJ = min(dataSet[:,j]) dataSet是一个mat类型的numpy矩阵。 dataSet[:,j] 是什么意思啊?请教各位朋友,十分感谢
numpy.core.multiarray failed to import
# 问题: 使用cmd执行有import cv2 和 numpy的脚本会出现numpy.core.multiarray failed to import ![图片说明](https://img-ask.csdn.net/upload/201708/09/1502268358_642984.jpg) # 一些情况: **环境:** windows 10 python : 3.5.3 opencv-python: 3.3.0 numpy: 1.13.1 在**cmd**运行python,然后import 也会报错 ![图片说明](https://img-ask.csdn.net/upload/201708/09/1502268427_523346.jpg) numpy也是 ![图片说明](https://img-ask.csdn.net/upload/201708/09/1502268454_158067.jpg) **但是** 直接在cp里面是可以import cv2 和 numpy的, IDLE也可以跑程序(cmd里Python fliename.py失败的 ,用IDLE是可以运行的) # 采取过的措施 1. 重装numpy,opencv,乃至换过32位的Python(因为当时用64位的cmd进Python成功import过,但是并不能跑程序,后来还不行了) 2. pip install -U numpy (网上很多这个答案,其实没有用) 请问各路大神这个是什么原因,是环境变量的问题还是什么?
如何解决numpy.ndarray' object is not callable
我用python进行非线性规划时报错numpy.ndarray' object is not callable,有大佬可以帮忙解释一下吗 直到最后一句res=minimize。。。才报错,之前检查过都没有问题 ``` from scipy.optimize import minimize import numpy as np def fun(): v=lambda x:abs((x(1)+0*x(2)+0*x(3)+0*x(4)+0*x(5)+0*x(6)+0*x(7)+0*x(8)+0*x(9)+0*x(10)+0*x(11)+0*x(12)+0*x(13)+0*x(14))) return v def cons(): # d,e=args con=({'type':'eq','fun':lambda x: x(1)-(2171.4/0.85*x(2))}, {'type': 'eq', 'fun': lambda x: (x(5)*x(6)*89.496/6.28)-x(7)-x(8)}, {'type': 'eq', 'fun': lambda x: x(9)*x(10)-x(10)*x(11)-x(8)*x(11)}, {'type': 'eq', 'fun': lambda x: x(12) - x(13)+x(11)}, {'type': 'eq', 'fun': lambda x: x(10) - 12500*3.1415}, {'type': 'ineq', 'fun': lambda x: x(6) - x(14)}, {'type': 'ineq', 'fun': lambda x: x(3) - x(4)-2.45}, {'type': 'eq', 'fun': lambda x: x(14) - 12.14*3.1415}, {'type': 'ineq', 'fun': lambda x: x(4) - 2.45}, {'type': 'ineq', 'fun': lambda x: 97.55 - x(4)}, {'type': 'ineq', 'fun': lambda x: x(3) }, {'type': 'ineq', 'fun': lambda x: 95.1 - x(3)}, {'type': 'ineq', 'fun': lambda x: x(5)-2.45-x(4)}, {'type': 'ineq', 'fun': lambda x: 100-x(5)} ) return con a=fun() b=cons() # print(b) x0=np.asarray([3,4,3,2,3,4,3,2,3,4,3,2,3,2]) bounds=((0,None),(0,None),(0,None),(0,None),(0,None),(0,None),(0,None),(0,None),(0,None),(0,None),(0,None),(0,None),(0,None),(0,None)) res=minimize(a,x0,method='SLSQP',constraints=b,bounds=bounds) print(res) print(b) ```
矩阵乘法错误 (Python3.7; jupyter notebook 6.0.0; numpy 1.16.4)该怎么办?
本人六年级小学生,很想进军人工智能领域,于是搞了本《Python神经网络编程》来看(图1),安装搭建了jupyter,可是在训练神经网络(更新权重那一步)的时候出了问题,也不只是怎么回事,打了ipdb断点,一查,阵矩大小、形状都没有问题,可是jupyter一直报错矩阵无法相乘,求大神解答(更多信息见正文) ![《Python神经网络编程》](https://img-ask.csdn.net/upload/202001/22/1579668143_1165.jpg) 先贴一下错误信息: > ValueError: matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 3 is different from 5) 我百度了一下,这个好像是阵矩1的行与阵矩2的列不相同,我再次断点调试,各种一番捯饬,最后……额还是没找出问题…… 再贴一下诡异的jupyter运行截图: ![运行截图](https://img-ask.csdn.net/upload/202001/22/1579680986_443189.png) 图中可以看到框1是将要执行的语句,但是上一句打了ipdb断点,之后我在断点环境下执行了代码,结果成功了!!!成功了!!!可是我按下c之后就又报错了!!!求教啊,神马蛇皮走位?于是我再把断点去掉,又是同样的报错,放到导出py文件后本地执行也报错,神马情况??? 再贴一下train函数截图: ![图片说明](https://img-ask.csdn.net/upload/202001/22/1579680754_198010.png) 最后附上全部代码,方便大家解答: ```python import numpy import scipy.special # 神经网络 class Network: """神经网络类""" def __init__(self, nodes, l_rate): """神经网络初始化方法""" self.nodes = nodes self.lr = l_rate self.layer_num = len(nodes) self.weight_num = self.layer_num -1 self._init_layers() self._init_weights() self.activ = scipy.special.expit def _init_layers(self): """初始化所有神经层""" self.layers = [None for _ in range(self.layer_num)] for i in range(self.layer_num): # 本层的神经数 node_num = self.nodes[i] # 初始化本层神经,用0填充 self.layers[i] = numpy.zeros((node_num,)).T def _init_weights(self): """初始化所有权重""" self.weights = [None for _ in range(self.weight_num)] for i in range(self.weight_num): # 初始化本层权重,用[1/三√下一层神经数)]的正态分布填充 # 参数:1.正态分布中心 2.[1/(√下一层神经数)] 3.权重阵矩大小 self.weights[i] = numpy.random.normal(0.0, pow(self.nodes[i+1], -0.5), (self.nodes[i+1], self.nodes[i])) def query(self, inputs): """查询神经网络的结果""" assert len(inputs) is self.nodes[0] for i in range(self.layer_num): # 如果第是一遍遍历,将最后一次结果设为输入值 if i is 0: self.layers[0] = numpy.array(inputs, ndmin=2).T continue # 本轮神经计算值 self.layers[i] = self.weights[i - 1] @ self.layers[i - 1] self.layers[i] = self.activ(self.layers[i]) return self.layers[-1] def train(self, inputs, targets): """对神经网络进行训练""" assert len(targets) is self.nodes[-1] last_result = self.query(inputs) for i in reversed(range(self.weight_num)): if i is self.weight_num-1: errors = numpy.array(targets, ndmin=2).T - last_result else: errors = self.weights[i + 1] @ errors import ipdb; ipdb.set_trace() # 问题出在这一行↓↓↓ self.weights[i] += self.lr *((errors * self.layers[i+1] * (1.0 - self.layers[i+1])) @ self.layers[i].T) if __name__ == '__main__': nw = Network((3, 5, 5, 3), 0.01) for _ in range(10000): nw.train([1, 1, 1], [1, 1, 1]) results = nw.query([1, 1, 1]) print(results) ```
keras中model.evaluate()报错:'numpy.float64' object is not iterable
``` x_train, x_test, y_train, y_test = train_test_split(x_data, y_data, test_size=0.25) mean = x_train.mean(axis=0) std = x_train.std(axis=0) train_data = (x_train - mean) / std test_data = (x_test - mean) / std model = Sequential([Dense(64, input_shape=(6,)), Activation('relu'), Dense(32), Activation('relu'), Dense(1)]) sgd = keras.optimizers.SGD(lr=0.01, decay=1e-6, momentum=0.9, nesterov=True) model.compile(loss='mean_squared_error', optimizer=sgd) k = model.fit [loss, sgd] = model.evaluate(test_data, y_test, verbose=1) ``` 最后一步不知道哪出了问题。。test_data, y_test都是dataframe啊 TypeError Traceback (most recent call last) <ipython-input-29-3b0767a3c446> in <module> ----> 1 [loss, mse] = model.evaluate(test_data, y_test, verbose=1) TypeError: 'numpy.float64' object is not iterable
生成二维均匀分布的三维图报错AttributeError: 'int' object has no attribute 'ndim'?
* 生成二维均匀分布的三维图报错 * 代码如下: ``` from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np fig = plt.figure() ax = fig.gca(projection='3d') x=np.arange(0,1,0.01) y=np.arange(0,1,0.01) X,Y=np.meshgrid(x,y) Z1=1 Z2=0 surf=ax.plot_surface(X,Y,Z1,color='b') surf=ax.plot_surface(X,Y,Z2,color='r') plt.show() ``` * 报错信息 Traceback (most recent call last): File "二维均匀分布.py", line 15, in <module> surf=ax.plot_surface(X,Y,Z1,color='b') File "E:\DataAnalysis\python-3.7.0\lib\site-packages\mpl_toolkits\mplot3d\axes3d.py", line 1610, in plot_surface if Z.ndim != 2: AttributeError: 'int' object has no attribute 'ndim' * 截图 ![图片说明](https://img-ask.csdn.net/upload/201904/15/1555301940_905474.jpg) 给底面Z=0和均匀分布的平面Z=1染色,但显示这个问题,搜索了下,基本上没有与这个相似的。。。请教该如何改啊!~
AttributeError: 'module' object has no attribute 'to_rgba'
I met a strange problem when i using matplotlib with python 2.7, ubuntu 16.04 and jupyter web. The code is very simple, like: %matplotlib inline import numpy as np import matplotlib.pyplot as plt x = np.linspace(0, 10, 100) y = np.sin(x) plt.plot(x,y) plt.show() [<matplotlib.lines.Line2D at 0x7f9fef0410d0>] --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) /home/******/.local/lib/python2.7/site-packages/ipykernel/pylab/backend_inline.pyc in show(close, block) 37 display( 38 figure_manager.canvas.figure, ---> 39 metadata=_fetch_figure_metadata(figure_manager.canvas.figure) 40 ) 41 finally: /home/******/.local/lib/python2.7/site-packages/ipykernel/pylab/backend_inline.pyc in _fetch_figure_metadata(fig) 172 """Get some metadata to help with displaying a figure.""" 173 # determine if a background is needed for legibility --> 174 if _is_transparent(fig.get_facecolor()): 175 # the background is transparent 176 ticksLight = _is_light([label.get_color() /home/******/.local/lib/python2.7/site-packages/ipykernel/pylab/backend_inline.pyc in _is_transparent(color) 193 def _is_transparent(color): 194 """Determine transparency from alpha.""" --> 195 rgba = colors.to_rgba(color) 196 return rgba[3] < .5 AttributeError: 'module' object has no attribute 'to_rgba' 国外的一个朋友问我的,我也不知道为什么,matplotlib在终端用的好好地,在jupyter notebook中就报错了....... 很奇怪的一个错误, 哪位大佬帮解决一下。 错误指向colors没有to_rgba属性。 谢谢大佬
缺少 numpy.random.common
我使用python的tkinter编写了一个程序,用pyinstaller编译之后,程序提示 failed to execute script 文件名 错误提示: no module named 'numpy.random.common' 可是我重新pip numpy模块还是不好用 请问怎么解决? ``` #!/usr/bin/python # -- coding: utf-8 -- import fnmatch #选择文件的关键词 import os from time import sleep from tkinter import * import tkinter.filedialog #弹出选择路径的库 import tkinter.messagebox import fnmatch #选择文件的关键词 import re import pandas as pd import docx import pickle import codecs import string import shutil from win32com import client as wc def matchdocname(str1,root,i,list_box): if str1 in os.path.splitext(i)[0]: list_box.insert(END, root+"/"+i) def matchdoccontent(str1,root,i,list_box): if i.endswith('txt'): #当文件为txt时 with open(os.path.join(root, i) ,'r') as fp: errors='' aa=fp.read() if str1 in aa : list_box.insert(END, root+"/"+i) if i.endswith('xls') or i.endswith('xlsx') : #当文件为excel时 df=pd.read_excel(os.path.join(root, i)) df=df.values for k in df: for j in k: j=str(j) if str1 in j: list_box.insert(END, root+"/"+i) if i.endswith('docx'): #当文件为.docx时 word = wc.Dispatch('Word.Application') doc = word.Documents.Open(os.path.join(root, i)) newname=os.path.join(root, i)+"(translate txt)" doc.SaveAs(newname,4) doc.Close() word.Quit() with open(newname ,'r') as fp: errors='' aa=fp.read() if str1 in aa : list_box.insert(END, root+"/"+i) os.remove(newname) if i.endswith('doc'): #当文件为.doc时 word = wc.Dispatch('Word.Application') doc = word.Documents.Open(os.path.join(root, i)) newname=os.path.join(root, i)+"(translate txt)" doc.SaveAs(newname,4) doc.Close() word.Quit() with open(newname ,'r') as fp: errors='' aa=fp.read() if str1 in aa : list_box.insert(END, root+"/"+i) os.remove(newname) #删掉这个临时文件 def left(): if not entry.get() :#检测关键词输入框是否为空 tkinter.messagebox.showerror("提示信息:","出现以下错误:\n关键词不能为空")#弹出警告框 return #如果为空不再执行 if var1.get()==0 and var2.get()==0 : tkinter.messagebox.showerror("提示信息:","出现以下错误:\n匹配项不能为空")#弹出警告框 return #如果为空不再执行 list_box.delete(0,END) path = tkinter.filedialog.askdirectory()#弹出选择路径的窗口,path为获取的路径 path_list = os.walk(path)#获取一个列表目录的对象 for root, dirs, files in path_list: #print root, dirs, files if var1.get()==1 and var2.get()==0: #当只匹配文件名时 list_box.insert(END, '文件名') for i in files: matchdocname(entry.get(),root,i,list_box) elif var1.get()==0 and var2.get()==1: #当只匹配文件内容时 list_box.insert(END, '文件内容') for i in files: matchdoccontent(entry.get(),root,i,list_box) elif var1.get()==1 and var2.get()==1: #当既匹配文件名又匹配文件内容时 list_box.insert(END, '文件名') for i in files: matchdocname(entry.get(),root,i,list_box) list_box.insert(END, '--------------') list_box.insert(END, '文件内容') for i in files: matchdoccontent(entry.get(),root,i,list_box) def func2(e): if not list_box.curselection():#取双击的坐标52 return path = list_box.get(list_box.curselection(),last=None) os.startfile(path) def nagea(e): error = '' tdir = dirs.get(dirs.curselection()) if os.path.isfile(tdir): #如果是文件 则打开 os.startfile(tdir) elif os.path.isdir(tdir): #如果是文件夹 则调用dols setDirAndGo() def wenjianshu(): dirs.delete(0,END) path = tkinter.filedialog.askdirectory()#弹出选择路径的窗口,path为获取的路径 doLS1(path) #双击时调用,双击时,设置背景色为红色,并调用doLS函数打开所选文件 def setDirAndGo(ev=None): last = cwd.get() dirs.config(selectbackground='red') check = dirs.get(dirs.curselection()) if not check: check = os.curdir cwd.set(check) doLS() #实现更新目录的核心函数 def doLS(ev=None): error = '' tdir = cwd.get() if not tdir:tdir=os.curdir #若路径输入错误,或者打开的是文件,而不是目录,则更新错误提示信息 if not os.path.exists(tdir): error = os.getcwd()+'\\'+tdir + ':未找到文件' elif not os.path.isdir(tdir): error = os.getcwd()+'\\'+tdir + ':未找到目录' if error: cwd.set(error) top2.update() sleep(1) cwd.set(os.curdir) dirs.config(selectbackground='LightSkyBlue') top2.update() return cwd.set(os.getcwd()+'\\'+tdir) top2.update() dirlist = os.listdir(tdir)#os.listdir() 方法用于返回指定的文件夹包含的文件或文件夹的名字的列表。 dirlist.sort() os.chdir(tdir)#os.chdir() 方法用于改变当前工作目录到指定的路径。 #更新界面上方标签内容 dirl.config(text=os.getcwd()) top2.update() dirs.delete(0,END) dirs.insert(END,os.pardir)#os.chdir(os.pardir) 切换到上级目录 即将上级目录.. 插入到dirs对象中 #把选定目录的文件或文件夹的名字的列表依次插入到dirs对象中 for eachFile in dirlist: dirs.insert(END,eachFile) cwd.set(os.curdir) dirs.config(selectbackground='LightSkyBlue') def doLS1(tdir): error = '' if not tdir:tdir=os.curdir #若路径输入错误,或者打开的是文件,而不是目录,则更新错误提示信息 if not os.path.exists(tdir): error = os.getcwd()+'\\'+tdir + ':未找到文件' elif not os.path.isdir(tdir): error = os.getcwd()+'\\'+tdir + ':未找到目录' if error: cwd.set(error) top2.update() sleep(1) cwd.set(os.curdir) dirs.config(selectbackground='LightSkyBlue') top2.update() return cwd.set(os.getcwd()+'\\'+tdir) top2.update() dirlist = os.listdir(tdir)#os.listdir() 方法用于返回指定的文件夹包含的文件或文件夹的名字的列表。 dirlist.sort os.chdir(tdir)#os.chdir() 方法用于改变当前工作目录到指定的路径。 #更新界面上方标签内容 dirl.config(text=os.getcwd()) top2.update() dirs.delete(0,END) dirs.insert(END,os.pardir)#os.chdir(os.pardir) 切换到上级目录 即将上级目录.. 插入到dirs对象中 #把选定目录的文件或文件夹的名字的列表依次插入到dirs对象中 for eachFile in dirlist: dirs.insert(END,eachFile) cwd.set(os.curdir) dirs.config(selectbackground='LightSkyBlue') top2 = Tk() top2.title('营销集约管控中心-文件管理') top2.geometry('+50+50')#窗口大小,窗口位置 cwd = StringVar(top2) var=IntVar() dirl = Label(top2,fg = 'BLUE',font = ('Helvetica',18,'bold')) dirl.pack() dirfm = Frame(top2) dirs = Listbox(dirfm,height=25,width=90) #通过使用List的bind()方法,将鼠标双击事件绑定,并调用setDirAndGo函数 dirs.bind('<Double-1>',nagea) dirs.pack(side=LEFT,fill=BOTH) list_box = Listbox(dirfm,height=25,width=90) list_box.bind('<Double-Button-1>',func2) #绑定一个双击触发事件 list_box.pack(side=LEFT,fill=BOTH)#显示列表框 dirfm.pack() #第二个框架bfm,放置按钮 bfm = Frame(top2) open1 = Button(bfm,text='文件树',command=wenjianshu,activeforeground='white',activebackground='blue') open1.pack(side=LEFT) bfm.pack(side=LEFT,fill=BOTH) #多选框插件 var1 = tkinter.IntVar() # 用来储存下面勾选项1中返回的0或1 var2 = tkinter.IntVar() # 用来储存下面勾选项2中返回的0或1 button2=tkinter.Checkbutton(top2,text="匹配文件内容",variable=var2,onvalue=1,offvalue=0) button2.pack(side=RIGHT,fill=BOTH) button1=tkinter.Checkbutton(top2,text="匹配文件名",variable=var1,onvalue=1,offvalue=0) button1.pack(side=RIGHT,fill=BOTH) #按钮控件 entry = Entry()#输入框实例化 entry.pack(side=RIGHT,fill=BOTH)#输入框 button2=Button(top2,text="关键字",command=left) button2.pack(side=RIGHT,fill=BOTH) if __name__ =='__main__': #设定初始目录为桌面 mainloop() ```
numpy.array()打开图片时像素点表示问题
在应用numpy.array()打开图片 代码如下: ``` i = Image.open('images/numbers/0.1.png') iar = np.array(i, dtype='int64') print(iar) ``` 输出结果中大部分为 [[[255 255 255 255] ...... (即alpha数值有表示出来) 而另一张图片,可能就会输出 [[[255 255 255] ...... (即alpha数值没有表示出来) 想请教一下这是为什么呢,有没有什么办法可以把它们统一起来吗?
pyinstaller打包处理的程序用不了
warn-xxx.txt文件的信息如下,求大佬处理 This file lists modules PyInstaller was not able to find. This does not necessarily mean this module is required for running you program. Python and Python 3rd-party packages include a lot of conditional or optional module. For example the module 'ntpath' only exists on Windows, whereas the module 'posixpath' only exists on Posix systems. Types if import: * top-level: imported at the top-level - look at these first * conditional: imported within an if-statement * delayed: imported from within a function * optional: imported within a try-except-statement IMPORTANT: Do NOT post this list to the issue-tracker. Use it as a basis for yourself tracking down the missing module. Thanks! missing module named pyimod03_importers - imported by PyInstaller.loader.pyimod02_archive (delayed, conditional), c:\program files\python37\lib\site-packages\PyInstaller\loader\rthooks\pyi_rth_pkgres.py (top-level) missing module named 'pkg_resources.extern.pyparsing' - imported by pkg_resources._vendor.packaging.requirements (top-level), pkg_resources._vendor.packaging.markers (top-level) missing module named 'com.sun' - imported by pkg_resources._vendor.appdirs (delayed, conditional, optional) missing module named com - imported by pkg_resources._vendor.appdirs (delayed) missing module named win32api - imported by distutils.msvccompiler (optional), pkg_resources._vendor.appdirs (delayed, conditional, optional) missing module named win32com.shell - imported by pkg_resources._vendor.appdirs (delayed, conditional, optional) missing module named _uuid - imported by uuid (optional) missing module named netbios - imported by uuid (delayed) missing module named win32wnet - imported by uuid (delayed) missing module named __builtin__ - imported by numpy.core.numerictypes (conditional), numpy.core.numeric (conditional), numpy.lib.function_base (conditional), numpy.lib._iotools (conditional), numpy.ma.core (conditional), numpy.distutils.misc_util (delayed, conditional), numpy (conditional), pymysql._compat (conditional), pkg_resources._vendor.pyparsing (conditional), setuptools._vendor.pyparsing (conditional) missing module named ordereddict - imported by pkg_resources._vendor.pyparsing (optional), setuptools._vendor.pyparsing (optional) missing module named StringIO - imported by PyInstaller.lib.modulegraph._compat (conditional), PyInstaller.lib.modulegraph.zipio (conditional), setuptools._vendor.six (conditional), numpy.lib.utils (delayed, conditional), numpy.lib.format (delayed, conditional), numpy.testing._private.utils (conditional), six (conditional), urllib3.packages.six (conditional), requests.compat (conditional), selenium.webdriver.remote.webelement (optional), pkg_resources._vendor.six (conditional) missing module named _scproxy - imported by urllib.request (conditional) missing module named 'macholib.MachO' - imported by PyInstaller.depend.dylib (delayed), PyInstaller.depend.bindepend (delayed), PyInstaller.utils.osx (top-level) missing module named macholib - imported by PyInstaller.depend.dylib (delayed, conditional) missing module named _pkgutil - imported by PyInstaller.lib.modulegraph.modulegraph (delayed, optional) missing module named dis3 - imported by PyInstaller.lib.modulegraph._compat (conditional) missing module named urllib.pathname2url - imported by urllib (conditional), PyInstaller.lib.modulegraph._compat (conditional) missing module named pyimod00_crypto_key - imported by PyInstaller.loader.pyimod02_archive (delayed, optional) missing module named thread - imported by numpy.core.arrayprint (conditional, optional), PyInstaller.loader.pyimod02_archive (conditional) missing module named 'macholib.dyld' - imported by PyInstaller.depend.bindepend (delayed) missing module named 'macholib.mach_o' - imported by PyInstaller.depend.bindepend (delayed) missing module named Crypto - imported by PyInstaller.building.makespec (delayed, conditional, optional) missing module named win32ctypes.core._time - imported by win32ctypes.core (top-level), win32ctypes.pywin32.win32api (top-level) missing module named win32ctypes.core._system_information - imported by win32ctypes.core (top-level), win32ctypes.pywin32.win32api (top-level) missing module named win32ctypes.core._resource - imported by win32ctypes.core (top-level), win32ctypes.pywin32.win32api (top-level) missing module named win32ctypes.core._dll - imported by win32ctypes.core (top-level), win32ctypes.pywin32.win32api (top-level) missing module named win32ctypes.core._common - imported by win32ctypes.core (top-level), win32ctypes.pywin32.win32api (top-level), win32ctypes.pywin32.win32cred (top-level) missing module named win32ctypes.core._authentication - imported by win32ctypes.core (top-level), win32ctypes.pywin32.win32cred (top-level) missing module named cffi - imported by win32ctypes.core (optional) missing module named UserDict - imported by PyInstaller.compat (conditional), pytz.lazy (optional) missing module named multiprocessing.set_start_method - imported by multiprocessing (top-level), multiprocessing.spawn (top-level) missing module named multiprocessing.get_start_method - imported by multiprocessing (top-level), multiprocessing.spawn (top-level) missing module named multiprocessing.TimeoutError - imported by multiprocessing (top-level), multiprocessing.pool (top-level) missing module named multiprocessing.get_context - imported by multiprocessing (top-level), multiprocessing.pool (top-level), multiprocessing.managers (top-level), multiprocessing.sharedctypes (top-level) missing module named multiprocessing.BufferTooShort - imported by multiprocessing (top-level), multiprocessing.connection (top-level) missing module named multiprocessing.AuthenticationError - imported by multiprocessing (top-level), multiprocessing.connection (top-level) missing module named pkg_resources.extern.packaging - imported by pkg_resources.extern (top-level), pkg_resources (top-level) missing module named pkg_resources.extern.appdirs - imported by pkg_resources.extern (top-level), pkg_resources (top-level) missing module named 'pkg_resources.extern.six.moves' - imported by pkg_resources (top-level), pkg_resources._vendor.packaging.requirements (top-level) missing module named pkg_resources.extern.six - imported by pkg_resources.extern (top-level), pkg_resources (top-level) missing module named 'multiprocessing.forking' - imported by c:\program files\python37\lib\site-packages\PyInstaller\loader\rthooks\pyi_rth_multiprocessing.py (optional) missing module named resource - imported by posix (top-level), E:\yxrj\dingzhi\cj\231.py (top-level) missing module named posix - imported by os (conditional, optional), E:\yxrj\dingzhi\cj\231.py (top-level) missing module named _posixsubprocess - imported by subprocess (conditional), multiprocessing.util (delayed), E:\yxrj\dingzhi\cj\231.py (top-level) missing module named readline - imported by cmd (delayed, conditional, optional), code (delayed, conditional, optional), pdb (delayed, optional), E:\yxrj\dingzhi\cj\231.py (top-level) excluded module named _frozen_importlib - imported by importlib (optional), importlib.abc (optional), PyInstaller.loader.pyimod02_archive (delayed, conditional), E:\yxrj\dingzhi\cj\231.py (top-level) missing module named _frozen_importlib_external - imported by importlib._bootstrap (delayed), importlib (optional), importlib.abc (optional), E:\yxrj\dingzhi\cj\231.py (top-level) missing module named _winreg - imported by platform (delayed, optional), numpy.distutils.cpuinfo (delayed, conditional, optional), requests.utils (delayed, conditional, optional), selenium.webdriver.firefox.firefox_binary (delayed, optional), E:\yxrj\dingzhi\cj\231.py (top-level), pkg_resources._vendor.appdirs (delayed) missing module named java - imported by platform (delayed), E:\yxrj\dingzhi\cj\231.py (top-level) missing module named 'java.lang' - imported by platform (delayed, optional), xml.sax._exceptions (conditional), E:\yxrj\dingzhi\cj\231.py (top-level) missing module named vms_lib - imported by platform (delayed, conditional, optional), E:\yxrj\dingzhi\cj\231.py (top-level) missing module named termios - imported by tty (top-level), getpass (optional), E:\yxrj\dingzhi\cj\231.py (top-level) missing module named urllib.getproxies_environment - imported by urllib (conditional), requests.compat (conditional) missing module named urllib.proxy_bypass_environment - imported by urllib (conditional), requests.compat (conditional) missing module named urllib.proxy_bypass - imported by urllib (conditional), requests.compat (conditional) missing module named urllib.getproxies - imported by urllib (conditional), requests.compat (conditional) missing module named urllib.unquote_plus - imported by urllib (conditional), requests.compat (conditional) missing module named urllib.quote_plus - imported by urllib (conditional), requests.compat (conditional) missing module named urllib.unquote - imported by urllib (conditional), requests.compat (conditional) missing module named urllib.urlencode - imported by urllib (optional), urllib3.packages.rfc3986.compat (optional), requests.compat (conditional) missing module named urllib.quote - imported by urllib (optional), urllib3.packages.rfc3986.compat (optional), requests.compat (conditional) missing module named grp - imported by shutil (optional), tarfile (optional), pathlib (delayed), distutils.archive_util (optional), E:\yxrj\dingzhi\cj\231.py (top-level) missing module named 'org.python' - imported by pickle (optional), xml.sax (delayed, conditional), setuptools.sandbox (conditional), E:\yxrj\dingzhi\cj\231.py (top-level) missing module named org - imported by copy (optional), E:\yxrj\dingzhi\cj\231.py (top-level) missing module named pwd - imported by posixpath (delayed, conditional), shutil (optional), tarfile (optional), http.server (delayed, optional), webbrowser (delayed), pathlib (delayed, conditional, optional), distutils.util (delayed, conditional), distutils.archive_util (optional), netrc (delayed, conditional), getpass (delayed), E:\yxrj\dingzhi\cj\231.py (top-level) missing module named urllib2 - imported by numpy.lib._datasource (delayed, conditional), requests.compat (conditional), selenium.webdriver.common.utils (delayed, optional), selenium.webdriver.common.service (delayed, optional) missing module named urlparse - imported by numpy.lib._datasource (delayed, conditional), requests.compat (conditional), selenium.webdriver.remote.remote_connection (optional) runtime module named urllib3.packages.six.moves - imported by http.client (top-level), urllib3.connectionpool (top-level), urllib3.util.response (top-level), 'urllib3.packages.six.moves.urllib' (top-level), urllib3.response (top-level), urllib3.util.queue (top-level) missing module named 'OpenSSL.crypto' - imported by urllib3.contrib.pyopenssl (delayed) missing module named 'cryptography.x509' - imported by urllib3.contrib.pyopenssl (delayed, optional) missing module named 'cryptography.hazmat' - imported by pymysql._auth (optional), urllib3.contrib.pyopenssl (top-level) missing module named cryptography - imported by pymysql._auth (optional), urllib3.contrib.pyopenssl (top-level), requests (optional) missing module named OpenSSL - imported by urllib3.contrib.pyopenssl (top-level) missing module named 'backports.ssl_match_hostname' - imported by setuptools.ssl_support (optional), urllib3.packages.ssl_match_hostname (optional) missing module named brotli - imported by urllib3.util.request (optional), urllib3.response (optional) missing module named "'urllib3.packages.six.moves.urllib'.parse" - imported by urllib3.request (top-level), urllib3.poolmanager (top-level) missing module named Queue - imported by urllib3.util.queue (conditional) missing module named httplib - imported by selenium.webdriver.safari.webdriver (optional), selenium.webdriver.blackberry.webdriver (optional), selenium.webdriver.webkitgtk.webdriver (optional) missing module named cStringIO - imported by selenium.webdriver.firefox.firefox_profile (optional) missing module named copy_reg - imported by numpy.core (conditional), soupsieve.util (conditional), cStringIO (top-level) missing module named 'backports.functools_lru_cache' - imported by soupsieve.util (conditional) missing module named iconv_codec - imported by bs4.dammit (optional) missing module named cchardet - imported by bs4.dammit (optional) missing module named lxml - imported by bs4.builder._lxml (top-level) missing module named 'html5lib.treebuilders' - imported by bs4.builder._html5lib (optional) missing module named 'html5lib.constants' - imported by bs4.builder._html5lib (top-level) missing module named html5lib - imported by bs4.builder._html5lib (top-level) missing module named Cookie - imported by requests.compat (conditional) missing module named cookielib - imported by requests.compat (conditional) missing module named simplejson - imported by pandas.util._print_versions (delayed, conditional, optional), requests.compat (optional) missing module named socks - imported by urllib3.contrib.socks (optional) missing module named _dummy_threading - imported by dummy_threading (optional) missing module named ConfigParser - imported by numpy.distutils.system_info (conditional), numpy.distutils.npy_pkg_config (conditional), pymysql.optionfile (conditional) missing module named scipy - imported by numpy.testing._private.nosetester (delayed, conditional), pandas.core.missing (delayed) missing module named numexpr - imported by pandas.core.computation.expressions (conditional), pandas.core.computation.engines (delayed) missing module named 'scipy.stats' - imported by pandas.plotting._matplotlib.hist (delayed), pandas.plotting._matplotlib.misc (delayed, conditional), pandas.core.nanops (delayed, conditional) missing module named 'scipy.signal' - imported by pandas.core.window (delayed, conditional) missing module named commands - imported by numpy.distutils.cpuinfo (conditional) missing module named setuptools.extern.packaging - imported by setuptools.extern (top-level), setuptools.dist (top-level), setuptools.command.egg_info (top-level) missing module named 'setuptools.extern.six' - imported by setuptools (top-level), setuptools.extension (top-level) missing module named setuptools.extern.six.moves.filterfalse - imported by setuptools.extern.six.moves (top-level), setuptools.dist (top-level), setuptools.msvc (top-level) missing module named setuptools.extern.six.moves.filter - imported by setuptools.extern.six.moves (top-level), setuptools.dist (top-level), setuptools.ssl_support (top-level), setuptools.command.py36compat (top-level) missing module named _manylinux - imported by setuptools.pep425tags (delayed, optional) missing module named wincertstore - imported by setuptools.ssl_support (delayed, optional) missing module named backports - imported by setuptools.ssl_support (optional) missing module named 'setuptools._vendor.six.moves' - imported by 'setuptools._vendor.six.moves' (top-level) missing module named 'setuptools.extern.pyparsing' - imported by setuptools._vendor.packaging.requirements (top-level), setuptools._vendor.packaging.markers (top-level) missing module named 'setuptools.extern.packaging.version' - imported by setuptools.msvc (top-level) missing module named setuptools.extern.six.moves.map - imported by setuptools.extern.six.moves (top-level), setuptools.dist (top-level), setuptools.command.easy_install (top-level), setuptools.sandbox (top-level), setuptools.package_index (top-level), setuptools.ssl_support (top-level), setuptools.command.egg_info (top-level), setuptools.namespaces (top-level) runtime module named setuptools.extern.six.moves - imported by setuptools.dist (top-level), setuptools.py33compat (top-level), setuptools.command.easy_install (top-level), setuptools.sandbox (top-level), setuptools.command.setopt (top-level), setuptools.package_index (top-level), setuptools.ssl_support (top-level), setuptools.command.egg_info (top-level), setuptools.command.py36compat (top-level), setuptools.namespaces (top-level), setuptools.msvc (top-level), 'setuptools._vendor.six.moves' (top-level) missing module named setuptools.extern.six - imported by setuptools.extern (top-level), setuptools.monkey (top-level), setuptools.dist (top-level), setuptools.extern.six.moves (top-level), setuptools.py33compat (top-level), setuptools.config (top-level), setuptools.command.easy_install (top-level), setuptools.sandbox (top-level), setuptools.py27compat (top-level), setuptools.package_index (top-level), setuptools.wheel (top-level), setuptools.command.egg_info (top-level), setuptools.command.sdist (top-level), setuptools.command.bdist_egg (top-level), setuptools.unicode_utils (top-level), setuptools.glob (top-level), setuptools.command.develop (top-level) missing module named 'numpy_distutils.cpuinfo' - imported by numpy.f2py.diagnose (delayed, conditional, optional) missing module named 'numpy_distutils.fcompiler' - imported by numpy.f2py.diagnose (delayed, conditional, optional) missing module named 'numpy_distutils.command' - imported by numpy.f2py.diagnose (delayed, conditional, optional) missing module named numpy_distutils - imported by numpy.f2py.diagnose (delayed, optional) missing module named 'nose.plugins' - imported by numpy.testing._private.noseclasses (top-level), numpy.testing._private.nosetester (delayed) missing module named numpy.core.number - imported by numpy.core (delayed), numpy.testing._private.utils (delayed) missing module named numpy.core.signbit - imported by numpy.core (delayed), numpy.testing._private.utils (delayed) missing module named numpy.core.float64 - imported by numpy.core (delayed), numpy.testing._private.utils (delayed) missing module named numpy.core.integer - imported by numpy.core (top-level), numpy.fft.helper (top-level) missing module named numpy.core.conjugate - imported by numpy.core (top-level), numpy.fft.pocketfft (top-level) missing module named numpy.core.sign - imported by numpy.core (top-level), numpy.linalg.linalg (top-level) missing module named numpy.core.divide - imported by numpy.core (top-level), numpy.linalg.linalg (top-level) missing module named numpy.core.object_ - imported by numpy.core (top-level), numpy.linalg.linalg (top-level) missing module named numpy.core.geterrobj - imported by numpy.core (top-level), numpy.linalg.linalg (top-level) missing module named numpy.core.sqrt - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.fft.pocketfft (top-level) missing module named numpy.core.add - imported by numpy.core (top-level), numpy.linalg.linalg (top-level) missing module named numpy.core.complexfloating - imported by numpy.core (top-level), numpy.linalg.linalg (top-level) missing module named numpy.core.inexact - imported by numpy.core (top-level), numpy.linalg.linalg (top-level) missing module named numpy.core.cdouble - imported by numpy.core (top-level), numpy.linalg.linalg (top-level) missing module named numpy.core.csingle - imported by numpy.core (top-level), numpy.linalg.linalg (top-level) missing module named numpy.core.double - imported by numpy.core (top-level), numpy.linalg.linalg (top-level) missing module named numpy.core.single - imported by numpy.core (top-level), numpy.linalg.linalg (top-level) missing module named numpy.core.float32 - imported by numpy.core (top-level), numpy.testing._private.utils (top-level) missing module named numpy.core.intp - imported by numpy.core (top-level), numpy.testing._private.utils (top-level), numpy.linalg.linalg (top-level) missing module named numpy.eye - imported by numpy (delayed), numpy.core.numeric (delayed) missing module named dummy_thread - imported by numpy.core.arrayprint (conditional, optional) missing module named 'nose.util' - imported by numpy.testing._private.noseclasses (top-level) missing module named nose - imported by numpy.testing._private.utils (delayed, optional), numpy.testing._private.decorators (delayed), numpy.testing._private.noseclasses (top-level) missing module named win32pdh - imported by numpy.testing._private.utils (delayed, conditional) missing module named __svn_version__ - imported by numpy.f2py.__version__ (optional) missing module named numarray - imported by numpy.distutils.system_info (delayed, conditional, optional) missing module named Numeric - imported by numpy.distutils.system_info (delayed, conditional, optional) missing module named win32con - imported by distutils.msvccompiler (optional) missing module named _curses - imported by curses (top-level), curses.has_key (top-level) missing module named pytest - imported by numpy._pytesttester (delayed), pandas.util._tester (delayed, optional), pandas.util.testing (delayed, conditional, optional) missing module named future_builtins - imported by numpy.lib.npyio (conditional) missing module named cpickle - imported by numpy.compat.py3k (conditional) missing module named pickle5 - imported by numpy.compat.py3k (conditional, optional) missing module named numpy.histogramdd - imported by numpy (delayed), numpy.lib.twodim_base (delayed) missing module named numpy.lib.i0 - imported by numpy.lib (top-level), numpy.dual (top-level) missing module named 'scipy.sparse' - imported by pandas.core.sparse.scipy_sparse (delayed), pandas.core.arrays.sparse (delayed), pandas.core.dtypes.common (delayed, conditional, optional) missing module named botocore - imported by pandas.io.s3 (delayed) missing module named 'pyarrow.parquet' - imported by pandas.io.parquet (delayed) missing module named pyarrow - imported by pandas.io.feather_format (delayed) missing module named contextmanager - imported by dateutil.tz.tz (optional) runtime module named six.moves - imported by dateutil.tz.tz (top-level), dateutil.tz.win (top-level), dateutil.rrule (top-level) missing module named six.moves.range - imported by six.moves (top-level), dateutil.rrule (top-level) missing module named dateutil.tz.tzfile - imported by dateutil.tz (top-level), dateutil.zoneinfo (top-level) missing module named dateutil.tz.tzlocal - imported by dateutil.tz (top-level), dateutil.rrule (top-level) missing module named dateutil.tz.tzutc - imported by dateutil.tz (top-level), dateutil.rrule (top-level) missing module named PyQt4 - imported by pandas.io.clipboard.clipboards (delayed, optional), pandas.io.clipboard (delayed, conditional, optional) missing module named PyQt5 - imported by pandas.io.clipboard.clipboards (delayed, optional), pandas.io.clipboard (delayed, conditional, optional) missing module named qtpy - imported by pandas.io.clipboard.clipboards (delayed, optional), pandas.io.clipboard (delayed, conditional, optional) missing module named 'sqlalchemy.types' - imported by pandas.io.sql (delayed, conditional) missing module named 'sqlalchemy.schema' - imported by pandas.io.sql (delayed, conditional) missing module named sqlalchemy - imported by pandas.io.sql (delayed, conditional, optional) missing module named tables - imported by pandas.io.pytables (delayed, conditional) missing module named xlwt - imported by pandas.io.excel._xlwt (delayed) missing module named xlsxwriter - imported by pandas.io.excel._xlsxwriter (delayed) missing module named 'openpyxl.styles' - imported by pandas.io.excel._openpyxl (delayed) missing module named 'openpyxl.style' - imported by pandas.io.excel._openpyxl (delayed) missing module named openpyxl - imported by pandas.io.excel._openpyxl (delayed, conditional) missing module named xlrd - imported by pandas.io.excel._xlrd (delayed) missing module named 'odf.namespaces' - imported by pandas.io.excel._odfreader (delayed) missing module named 'odf.table' - imported by pandas.io.excel._odfreader (delayed) missing module named 'odf.opendocument' - imported by pandas.io.excel._odfreader (delayed) missing module named odf - imported by pandas.io.excel._odfreader (delayed) missing module named matplotlib - imported by pandas.plotting._matplotlib.boxplot (top-level), pandas.plotting._matplotlib.compat (delayed, optional), pandas.plotting._matplotlib.timeseries (delayed), pandas.plotting._matplotlib.core (delayed), pandas.io.formats.style (optional) missing module named 'matplotlib.pyplot' - imported by pandas.plotting._matplotlib.style (delayed), pandas.plotting._matplotlib.tools (delayed), pandas.plotting._matplotlib.core (delayed), pandas.plotting._matplotlib.timeseries (delayed), pandas.plotting._matplotlib.boxplot (delayed), pandas.plotting._matplotlib.hist (delayed), pandas.plotting._matplotlib.misc (delayed), pandas.plotting._matplotlib (delayed), pandas.io.formats.style (optional), pandas.util.testing (delayed) missing module named numpy.array - imported by numpy (top-level), numpy.ma.core (top-level), numpy.ma.extras (top-level), numpy.ma.mrecords (top-level), numpy.ctypeslib (top-level) missing module named numpy.recarray - imported by numpy (top-level), numpy.ma.mrecords (top-level) missing module named numpy.ndarray - imported by numpy (top-level), numpy.ma.core (top-level), numpy.ma.extras (top-level), numpy.ma.mrecords (top-level), numpy.ctypeslib (top-level), pandas.compat.numpy.function (top-level) missing module named numpy.dtype - imported by numpy (top-level), numpy.ma.mrecords (top-level), numpy.ctypeslib (top-level) missing module named numpy.bool_ - imported by numpy (top-level), numpy.ma.core (top-level), numpy.ma.mrecords (top-level) missing module named 'matplotlib.ticker' - imported by pandas.plotting._matplotlib.converter (top-level), pandas.plotting._matplotlib.tools (top-level), pandas.plotting._matplotlib.core (delayed) missing module named 'matplotlib.table' - imported by pandas.plotting._matplotlib.tools (top-level) missing module named 'matplotlib.colors' - imported by pandas.plotting._matplotlib.style (top-level) missing module named 'matplotlib.cm' - imported by pandas.plotting._matplotlib.style (top-level) missing module named 'matplotlib.patches' - imported by pandas.plotting._matplotlib.misc (top-level) missing module named 'matplotlib.lines' - imported by pandas.plotting._matplotlib.misc (top-level) missing module named 'matplotlib.axes' - imported by pandas.plotting._matplotlib.core (delayed) missing module named 'matplotlib.units' - imported by pandas.plotting._matplotlib.converter (top-level) missing module named 'matplotlib.transforms' - imported by pandas.plotting._matplotlib.converter (top-level) missing module named 'matplotlib.dates' - imported by pandas.plotting._matplotlib.converter (top-level) missing module named numpy.expand_dims - imported by numpy (top-level), numpy.ma.core (top-level) missing module named numpy.iscomplexobj - imported by numpy (top-level), numpy.ma.core (top-level) missing module named numpy.amin - imported by numpy (top-level), numpy.ma.core (top-level) missing module named numpy.amax - imported by numpy (top-level), numpy.ma.core (top-level) missing module named 'IPython.core' - imported by pandas.io.formats.printing (delayed, conditional) missing module named IPython - imported by pandas.io.formats.printing (delayed) missing module named s3fs - imported by pandas.io.common (delayed, optional) missing module named sets - imported by pytz.tzinfo (optional) missing module named numpy.random.randn - imported by numpy.random (top-level), pandas.util.testing (top-level) missing module named numpy.random.rand - imported by numpy.random (top-level), pandas.util.testing (top-level) missing module named hypothesis - imported by pandas.util._tester (delayed, optional) missing module named 'lxml.etree' - imported by pandas.io.html (delayed) missing module named 'lxml.html' - imported by pandas.io.html (delayed)
运行tensorflow时出现tensorflow.python.framework.errors_impl.InternalError: Blas GEMM launch failed这个错误
运行tensorflow时出现tensorflow.python.framework.errors_impl.InternalError: Blas GEMM launch failed这个错误,查了一下说是gpu被占用了,从下面这里开始出问题的: ``` 2019-10-17 09:28:49.495166: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1304] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 6382 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1070, pci bus id: 0000:01:00.0, compute capability: 6.1) (60000, 28, 28) (60000, 10) 2019-10-17 09:28:51.275415: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cublas64_100.dll'; dlerror: cublas64_100.dll not found ``` ![图片说明](https://img-ask.csdn.net/upload/201910/17/1571277238_292620.png) 最后显示的问题: ![图片说明](https://img-ask.csdn.net/upload/201910/17/1571277311_655722.png) 试了一下网上的方法,比如加代码: ``` gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=0.333) sess = tf.Session(config=tf.ConfigProto(gpu_options=gpu_options)) ``` 但最后提示: ![图片说明](https://img-ask.csdn.net/upload/201910/17/1571277460_72752.png) 现在不知道要怎么解决了。新手想试下简单的数字识别,步骤也是按教程一步步来的,可能用的版本和教程不一样,我用的是刚下的:2.0tensorflow和以下: ![图片说明](https://img-ask.csdn.net/upload/201910/17/1571277627_439100.png) 不知道会不会有版本问题,现在紧急求助各位大佬,还有没有其它可以尝试的方法。测试程序加法运算可以执行,数字识别图片运行的时候我看了下,GPU最大占有率才0.2%,下面是完整数字图片识别代码: ``` import os import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers, optimizers, datasets os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' #gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=0.2) #sess = tf.Session(config=tf.ConfigProto(gpu_options=gpu_options)) gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=0.333) sess = tf.Session(config=tf.ConfigProto(gpu_options=gpu_options)) (x, y), (x_val, y_val) = datasets.mnist.load_data() x = tf.convert_to_tensor(x, dtype=tf.float32) / 255. y = tf.convert_to_tensor(y, dtype=tf.int32) y = tf.one_hot(y, depth=10) print(x.shape, y.shape) train_dataset = tf.data.Dataset.from_tensor_slices((x, y)) train_dataset = train_dataset.batch(200) model = keras.Sequential([ layers.Dense(512, activation='relu'), layers.Dense(256, activation='relu'), layers.Dense(10)]) optimizer = optimizers.SGD(learning_rate=0.001) def train_epoch(epoch): # Step4.loop for step, (x, y) in enumerate(train_dataset): with tf.GradientTape() as tape: # [b, 28, 28] => [b, 784] x = tf.reshape(x, (-1, 28 * 28)) # Step1. compute output # [b, 784] => [b, 10] out = model(x) # Step2. compute loss loss = tf.reduce_sum(tf.square(out - y)) / x.shape[0] # Step3. optimize and update w1, w2, w3, b1, b2, b3 grads = tape.gradient(loss, model.trainable_variables) # w' = w - lr * grad optimizer.apply_gradients(zip(grads, model.trainable_variables)) if step % 100 == 0: print(epoch, step, 'loss:', loss.numpy()) def train(): for epoch in range(30): train_epoch(epoch) if __name__ == '__main__': train() ``` 希望能有人给下建议或解决方法,拜谢!
theano 报错 module 'configparser' has no attribute 'ConfigParser' 用的是Anaconda3 python3.6
>theano 报错 module 'configparser' has no attribute 'ConfigParser' 用的是Win10 Anaconda3 python3.6 ``` from sklearn.datasets import load_boston import theano.tensor as T import numpy as np import matplotlib.pyplot as plt import theano class Layer(object): def __init__(self,inputs,in_size,out_size,activation_function=None): self.W = theano.shared(np.random.normal(0,1,(in_size,out_size))) self.b = theano.shared(np.zeros((out_size,)) + 0.1) self.Wx_plus_b = T.dot(inputs, self.W) + self.b self.activation_function = activation_function if activation_function is None: self.outputs = self.Wx_plus_b else: self.outputs = self.activation_function(self.Wx_plus_b) def minmax_normalization(data): xs_max = np.max(data, axis=0) xs_min = np.min(data, axis=0) xs = (1-0)*(data - xs_min)/(xs_max - xs_min) + 0 return xs np.random.seed(100) x_dataset = load_boston() x_data = x_dataset.data # minmax normalization, rescale the inputs x_data = minmax_normalization(x_data) y_data = x_dataset.target[:,np.newaxis] #cross validation, train test data split x_train, y_train = x_data[:400], y_data[:400] x_test, y_test = x_data[400:], y_data[400:] x = T.dmatrix('x') y = T.dmatrix('y') l1 = Layer(x, 13, 50, T.tanh) l2 = Layer(l1.outputs, 50, 1, None) #compute cost cost = T.mean(T.square(l2.outputs - y)) #cost = T.mean(T.square(l2.outputs - y)) + 0.1*((l1.W**2).sum() + (l2.W**2).sum()) #l2 regulization #cost = T.mean(T.square(l2.outputs - y)) + 0.1*(abs(l1.W).sum() + abs(l2.W).sum()) #l1 regulization gW1, gb1, gW2, gb2 = T.grad(cost, [l1.W,l1.b,l2.W,l2.b]) #gradient descend learning_rate = 0.01 train = theano.function(inputs=[x,y], updates=[(l1.W,l1.W-learning_rate*gW1), (l1.b,l1.b-learning_rate*gb1), (l2.W,l2.W-learning_rate*gW2), (l2.b,l2.b-learning_rate*gb2)]) compute_cost = theano.function(inputs=[x,y], outputs=cost) #record cost train_err_list = [] test_err_list = [] learning_time = [] for i in range(1000): if 1%10 == 0: #record cost train_err_list.append(compute_cost(x_train,y_train)) test_err_list.append(compute_cost(x_test,y_test)) learning_time.append(i) #plot cost history plt.plot(learning_time, train_err_list, 'r-') plt.plot(learning_time, test_err_list,'b--') plt.show() #作者 morvan莫凡 https://morvanzhou.github.io ``` 报错了: Traceback (most recent call last): File "C:/Users/Elena/PycharmProjects/theano/regularization.py", line 1, in <module> from sklearn.datasets import load_boston File "C:\Users\Elena\Anaconda3\lib\site-packages\sklearn\datasets\__init__.py", line 22, in <module> from .twenty_newsgroups import fetch_20newsgroups File "C:\Users\Elena\Anaconda3\lib\site-packages\sklearn\datasets\twenty_newsgroups.py", line 44, in <module> from ..feature_extraction.text import CountVectorizer File "C:\Users\Elena\Anaconda3\lib\site-packages\sklearn\feature_extraction\__init__.py", line 10, in <module> from . import text File "C:\Users\Elena\Anaconda3\lib\site-packages\sklearn\feature_extraction\text.py", line 28, in <module> from ..preprocessing import normalize File "C:\Users\Elena\Anaconda3\lib\site-packages\sklearn\preprocessing\__init__.py", line 6, in <module> from ._function_transformer import FunctionTransformer File "C:\Users\Elena\Anaconda3\lib\site-packages\sklearn\preprocessing\_function_transformer.py", line 5, in <module> from ..utils.testing import assert_allclose_dense_sparse File "C:\Users\Elena\Anaconda3\lib\site-packages\sklearn\utils\testing.py", line 61, in <module> from nose.tools import raises as _nose_raises File "C:\Users\Elena\Anaconda3\lib\site-packages\nose\__init__.py", line 1, in <module> from nose.core import collector, main, run, run_exit, runmodule File "C:\Users\Elena\Anaconda3\lib\site-packages\nose\core.py", line 11, in <module> from nose.config import Config, all_config_files File "C:\Users\Elena\Anaconda3\lib\site-packages\nose\config.py", line 6, in <module> import configparser File "C:\Users\Elena\Anaconda3\Lib\site-packages\theano\configparser.py", line 15, in <module> import theano File "C:\Users\Elena\Anaconda3\lib\site-packages\theano\__init__.py", line 88, in <module> from theano.configdefaults import config File "C:\Users\Elena\Anaconda3\lib\site-packages\theano\configdefaults.py", line 17, in <module> from theano.configparser import (AddConfigVar, BoolParam, ConfigParam, EnumStr, File "C:\Users\Elena\Anaconda3\lib\site-packages\theano\configparser.py", line 77, in <module> theano_cfg = (configparser.ConfigParser if PY3 **AttributeError: module 'configparser' has no attribute 'ConfigParser**' 把theano里的configparser.py文件里的ConfigParser改成了configparser还是不行 换了模块import configparsor也不行。。。![图片说明](https://img-ask.csdn.net/upload/201909/30/1569832318_223436.png)
关于归一化和numpy.log处理数据的疑问
在数据挖掘中, 有对数据进行归一化处理,比如StandardNormalization, 这种归一化处理的 好处是对异常的离散数值有很好的效果, 而numpy.log 可以对一些离散的异常数值有这种处理, 经过这种log处理后,得到的直方图更接近高斯分布, 我的问题是: 1. 我在网上看到一些大数据挖掘方面的资料,利用LogisticRegressor, 并没有对数据进行 归一化处理, 这种归一化是否不一定必须的 ? 2. 如果采用了 StandardNormalization 这种归一化处理,是否也相当于采用了Log处理的效果,而且数值被限定在更小的范围之内? 3. 数据挖掘中,如果用到 LogisticRegressor这种算法,是否直接对那些离散值直接进行StandardNormalization处理,不用采用Log处理?
python用matplotlib显示图片出错
源代码: import os from PIL import Image import matplotlib.pyplot as plt img = Image.open(os.path.join('', 'Testsample' + '.png')) plt.figure("Image") # 图像窗口名称 plt.imshow(img) plt.axis('on') # 关掉坐标轴为 off plt.title('image') # 图像题目 plt.show() 去掉plt.show(),就没有错误 错误提示: AttributeError: 'numpy.ndarray' object has no attribute 'mask'![图片说明](https://img-ask.csdn.net/upload/201803/19/1521467447_98280.png)
相见恨晚的超实用网站
相见恨晚的超实用网站 持续更新中。。。
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它是一个过程,是一个不断累积、不断沉淀、不断总结、善于传达自己的个人见解以及乐于分享的过程。
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过...
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 free -m 其中:m表示兆,也可以用g,注意都要小写 Men:表示物理内存统计 total:表示物理内存总数(total=used+free) use...
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入 假设现有4个人...
python 简易微信实现(注册登录+数据库存储+聊天+GUI+文件传输)
socket+tkinter详解+简易微信实现 历经多天的努力,查阅了许多大佬的博客后终于实现了一个简易的微信O(∩_∩)O~~ 简易数据库的实现 使用pands+CSV实现数据库框架搭建 import socket import threading from pandas import * import pymysql import csv # 创建DataFrame对象 # 存储用户数据的表(...
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发...
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 演示地点演示 html代码如下` music 这个年纪 七月的风 音乐 ` 然后就是css`*{ margin: 0; padding: 0; text-decoration: none; list-...
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。
数据库优化 - SQL优化
以实际SQL入手,带你一步一步走上SQL优化之路!
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 cpp 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7 p...
通俗易懂地给女朋友讲:线程池的内部原理
餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
将代码部署服务器,每日早上定时获取到天气数据,并发送到邮箱。 也可以说是一个小型人工智障。 知识可以运用在不同地方,不一定非是天气预报。
经典算法(5)杨辉三角
杨辉三角 是经典算法,这篇博客对它的算法思想进行了讲解,并有完整的代码实现。
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹...
面试官:你连RESTful都不知道我怎么敢要你?
干货,2019 RESTful最贱实践
刷了几千道算法题,这些我私藏的刷题网站都在这里了!
遥想当年,机缘巧合入了 ACM 的坑,周边巨擘林立,从此过上了"天天被虐似死狗"的生活… 然而我是谁,我可是死狗中的战斗鸡,智力不够那刷题来凑,开始了夜以继日哼哧哼哧刷题的日子,从此"读题与提交齐飞, AC 与 WA 一色 ",我惊喜的发现被题虐既刺激又有快感,那一刻我泪流满面。这么好的事儿作为一个正直的人绝不能自己独享,经过激烈的颅内斗争,我决定把我私藏的十几个 T 的,阿不,十几个刷题网...
JavaScript 为什么能活到现在?
作者 | 司徒正美 责编 |郭芮 出品 | CSDN(ID:CSDNnews) JavaScript能发展到现在的程度已经经历不少的坎坷,早产带来的某些缺陷是永久性的,因此浏览器才有禁用JavaScript的选项。甚至在jQuery时代有人问出这样的问题,jQuery与JavaScript哪个快?在Babel.js出来之前,发明一门全新的语言代码代替JavaScript...
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // doshom...
Nginx 原理和架构
Nginx 是一个免费的,开源的,高性能的 HTTP 服务器和反向代理,以及 IMAP / POP3 代理服务器。Nginx 以其高性能,稳定性,丰富的功能,简单的配置和低资源消耗而闻名。 Nginx 的整体架构 Nginx 里有一个 master 进程和多个 worker 进程。master 进程并不处理网络请求,主要负责调度工作进程:加载配置、启动工作进程及非停升级。worker 进程负责处...
致 Python 初学者
欢迎来到“Python进阶”专栏!来到这里的每一位同学,应该大致上学习了很多 Python 的基础知识,正在努力成长的过程中。在此期间,一定遇到了很多的困惑,对未来的学习方向感到迷茫。我非常理解你们所面临的处境。我从2007年开始接触 python 这门编程语言,从2009年开始单一使用 python 应对所有的开发工作,直至今天。回顾自己的学习过程,也曾经遇到过无数的困难,也曾经迷茫过、困惑过。开办这个专栏,正是为了帮助像我当年一样困惑的 Python 初学者走出困境、快速成长。希望我的经验能真正帮到你
Python 编程开发 实用经验和技巧
Python是一门很灵活的语言,也有很多实用的方法,有时候实现一个功能可以用多种方法实现,我这里总结了一些常用的方法和技巧,包括小数保留指定位小数、判断变量的数据类型、类方法@classmethod、制表符中文对齐、遍历字典、datetime.timedelta的使用等,会持续更新......
吐血推荐珍藏的Visual Studio Code插件
作为一名Java工程师,由于工作需要,最近一个月一直在写NodeJS,这种经历可以说是一部辛酸史了。好在有神器Visual Studio Code陪伴,让我的这段经历没有更加困难。眼看这段经历要告一段落了,今天就来给大家分享一下我常用的一些VSC的插件。 VSC的插件安装方法很简单,只需要点击左侧最下方的插件栏选项,然后就可以搜索你想要的插件了。 下面我们进入正题 Material Theme ...
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,...
程序员:我终于知道post和get的区别
是一个老生常谈的话题,然而随着不断的学习,对于以前的认识有很多误区,所以还是需要不断地总结的,学而时习之,不亦说乎
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU...
开源并不是你认为的那些事
点击上方蓝字 关注我们开源之道导读所以 ————想要理清开源是什么?先要厘清开源不是什么,名正言顺是句中国的古代成语,概念本身的理解非常之重要。大部分生物多样性的起源,...
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1...
Python 植物大战僵尸代码实现(2):植物卡片选择和种植
这篇文章要介绍的是: - 上方植物卡片栏的实现。 - 点击植物卡片,鼠标切换为植物图片。 - 鼠标移动时,判断当前在哪个方格中,并显示半透明的植物作为提示。
相关热词 c# 引用mysql c#动态加载非托管dll c# 两个表数据同步 c# 返回浮点json c# imap 链接状态 c# 漂亮字 c# 上取整 除法 c#substring c#中延时关闭 c#线段拖拉
立即提问