草庐IT

Expected

全部标签

python - 故障排除 "TypeError: ord() expected string of length 1, but int found"

ERROR:TypeError:ord()expectedstringoflength1,butintfound我在编译程序时遇到这个错误。File"C:\Users\Administrator\Desktop\tracer1.py",line129,inget_route("www.google.com")File"C:\Users\Administrator\Desktop\tracer1.py",line85,inget_routed=build_packet()File"C:\Users\Administrator\Desktop\tracer1.py",line62,inbu

python - 使用pyinstaller生成exe文件报错-typeerror : expected str, bytes or os.PathLike object, not NoneType

我正在尝试使用pysinstaller和Python3.7.2从.py文件构建一个.exe文件。它适用于Python3.6;然后我重新安装了最新版本的Python(3.7.2)并尝试生成一个exe文件,但是pyinstallerbarfs。下面是我得到的错误报告。(venv)C:\Users\user\Desktop\untitled1>pyinstallertest.py53INFO:PyInstaller:3.453INFO:Python:3.7.254INFO:Platform:Windows-10-10.0.17134-SP058INFO:wroteC:\Users\user\

python - Keras ValueError : Input 0 is incompatible with layer conv2d_1: expected ndim=4, 发现 ndim=5

我已经检查了所有的解决方案,但仍然面临同样的错误。我的训练图像形状是(26721,32,32,1),我认为它是4维的,但我不知道为什么错误显示它是5维的。model=Sequential()model.add(Convolution2D(16,5,5,border_mode='same',input_shape=input_shape))这就是我定义model.fit_generatormodel.fit_generator(train_dataset,train_labels,nb_epoch=epochs,verbose=1,validation_data=(valid_datas

python - 如何在 Windows 上使用 pip install 修复错误 “Expected version spec in …”?

在Windows7机器上,我使用以下命令从本地目录安装包:pipinstalladdons/pnc_tests--upgrade--extra-index-url=http://some_server/simple这会导致以下错误:C:\Users\alex\PNC\tas\ENV\Scripts\pip-script.pyrunon07/16/1407:50:47Exception:Traceback(mostrecentcalllast):File"C:\Users\alex\PNC\tas\ENV\lib\site-packages\pip\basecommand.py",lin

python - create_string_buffer 抛出错误 TypeError : str/bytes expected instead of str instance

我正在尝试这个简单的ctypes示例并得到提到的错误>>>fromctypesimportcreate_string_buffer>>>str=create_string_buffer("hello")Traceback(mostrecentcalllast):File"",line1,inFile"C:\Python32\lib\ctypes\__init__.py",line59,increate_string_bufferbuf.value=initTypeError:str/bytesexpectedinsteadofstrinstance有谁知道我做错了什么吗?同样,我试图将

python - 凯拉斯错误 : Expected to see 1 array

当我尝试在keras中训练MLP模型时出现以下错误(我使用的是keras版本1.2.2)Errorwhencheckingmodelinput:thelistofNumpyarraysthatyouarepassingtoyourmodelisnotthesizethemodelexpected.Expectedtosee1arraysbutinsteadgotthefollowinglistof12859arrays:这是模型的总结_____________________________________________________________________________

python - 类型错误 : expected a character buffer object

我在将值写入文件时遇到以下错误。你能帮我弄清楚这里的问题是什么以及如何解决吗?row=649withopen(r'\\loc\dev\Build_ver\build_ver.txt','r+')asf:f.write(row)printrow错误:Traceback(mostrecentcalllast):File"latest_rev.py",line6,inf.write(row)TypeError:expectedacharacterbufferobject 最佳答案 假设您只想将字符串'649'写入文件,将row更改为'64

Python csv 模块在 writer.writerow 处抛出 "Error: sequence expected"

我试图在Python中运行以下代码,但出现错误:csv.Error:sequenceexpected有人知道我的代码有什么问题吗?(该文件之前已导入到程序中)。importcsvfile=open('/home/btoms/Desktop/TomsBen/2000/01/01/20000101acme.mts','r')variables=[]file.readline()#Skipalinefile.readline()file.readline()#Skipanotherlineforlineinfile:tmp=line.split()tmp_STID=str(tmp[0])tm

javascript - 仅在 IE8 中使用 jQuery 时出现 "Object expected"错误

我只在IE中遇到错误(v8,我不知道它是否发生在旧的IE版本中,但它不会发生在Chrome或Firefox中)当我使用IE开发工具时,它给我带来了以下消息调试器:BreakingonJSScriptruntimeerror-ObjectExpected这是我受影响的代码:$('#deviceProfileSelection').change(function(){//affectedline!!!!//restofmycode...});此元素#deviceProfileSelection定义如下:我已经尝试将.change监听器定义为$(document).ready(functio

javascript - "The text content of element script was not in the required format: Expected space, tab, newline, or slash but found { instead."

根据W3C验证程序,我的HTML几乎与HTML5兼容,只剩下一个错误:配置GooglePlus按钮的Javascript代码。无论我是否添加CDATA,错误“元素script的文本内容不符合要求的格式:预期的空格、制表符、换行符或斜杠,但找到{而不是。”显示此行:{"lang":"en","parsetags":"explicit"} 最佳答案 错误信息是正确的。一个script标签,其src属性集canonlycontaindocumentation:空格和注释(/*...*/或//...)。如果你只是想避免这个错误,你可以尝试用