商城网站不易优化,哪里有网站制作价格,《c程序设计》精品课程网站建设,做网站哪个比较好报错解决
页面文件太小#xff0c;无法完成操作
训练过程中#xff0c;发生下图所示的报错#xff0c;同时pycharm崩溃 1. 更改虚拟内存
进入高级系统设置#xff0c;应该都会进#xff0c;就不说过程了 设置虚拟内存大小 2. 减小占用内容大小
新建一个fixNvPe.py程序…报错解决
页面文件太小无法完成操作
训练过程中发生下图所示的报错同时pycharm崩溃 1. 更改虚拟内存
进入高级系统设置应该都会进就不说过程了 设置虚拟内存大小 2. 减小占用内容大小
新建一个fixNvPe.py程序
# Simple script to disable ASLR and make .nv_fatb sections read-only
# Requires: pefile ( python -m pip install pefile )
# Usage: fixNvPe.py --input path/to/*.dllimport argparse
import pefile
import glob
import os
import shutildef main(args):failures []for file in glob.glob( args.input, recursiveargs.recursive ):print(f\n---\nChecking {file}...)pe pefile.PE(file, fast_loadTrue)nvbSect [ section for section in pe.sections if section.Name.decode().startswith(.nv_fatb)]if len(nvbSect) 1:sect nvbSect[0]size sect.Misc_VirtualSizeaslr pe.OPTIONAL_HEADER.IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASEwritable 0 ! ( sect.Characteristics pefile.SECTION_CHARACTERISTICS[IMAGE_SCN_MEM_WRITE] )print(fFound NV FatBin! Size: {size/1024/1024:0.2f}MB ASLR: {aslr} Writable: {writable})if (writable or aslr) and size 0:print(- Modifying DLL)if args.backup:bakFile f{file}_bakprint(f- Backing up [{file}] - [{bakFile}])if os.path.exists( bakFile ):print( f- Warning: Backup file already exists ({bakFile}), not modifying file! Delete the bak to allow modification)failures.append( file )continuetry:shutil.copy2( file, bakFile)except Exception as e:print( f- Failed to create backup! [{str(e)}], not modifying file!)failures.append( file )continue# Disable ASLR for DLL, and disable writing for sectionpe.OPTIONAL_HEADER.DllCharacteristics ~pefile.DLL_CHARACTERISTICS[IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE]sect.Characteristics sect.Characteristics ~pefile.SECTION_CHARACTERISTICS[IMAGE_SCN_MEM_WRITE]try:newFile f{file}_modprint( f- Writing modified DLL to [{newFile}])pe.write( newFile )pe.close()print( f- Moving modified DLL to [{file}])os.remove( file )shutil.move( newFile, file )except Exception as e:print( f- Failed to write modified DLL! [{str(e)}])failures.append( file )continueprint(\n\nDone!)if len(failures) 0:print(***WARNING**** These files needed modification but failed: )for failure in failures:print( f - {failure})def parseArgs():parser argparse.ArgumentParser( descriptionDisable ASLR and make .nv_fatb sections read-only, formatter_classargparse.ArgumentDefaultsHelpFormatter )parser.add_argument(--input, helpGlob to parse, default*.dll)parser.add_argument(--backup, helpBackup modified files, defaultTrue, requiredFalse)parser.add_argument(--recursive, -r, defaultFalse, actionstore_true, helpRecurse into subdirectories)return parser.parse_args()###############################
# program entry point
#
if __name__ __main__:args parseArgs()main( args )安装pefile
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pefile终端运行fixNvPe.py文件
python fixNvPe.py --input E:\kaifa\Anaconda3\envs\yolov5\lib\site-packages\torch\lib\cudnn_adv_infer64_8.dllintput后面的路径就是报错那里后面给的路径 出现下图所示表示执行完毕 RuntimeError: CUDA out of memory.
解决方式
换小模型 AttributeError: ‘FreeTypeFont’ object has no attribute ‘getsize’ 这是因为安装了新版本的 Pillow (10)pip install tf-models-official删除了该getsize 功能降级到 Pillow 9.5 解决了该问题
解决方式
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple Pillow9.5