cff29546 / pzmap2dzi

A command-line tool to convert Project Zomboid map data into Deep Zoom format
MIT License
47 stars 15 forks source link

Exception: cannot create im #7

Closed Tortoisecraft closed 9 months ago

Tortoisecraft commented 9 months ago

Hello, and thank you for contributing this tool to the PZ community!

Issue: I've tried to render the map twice and gotten the same failure towards the end of the process each time, copied below. Any help troubleshooting is very much appreciated! Can provide more info upon request.

Steps taken:

  1. Downloaded and installed Python, checked box to add to PATH
  2. Downloaded and extracted pzmap2dzi zip
  3. Ran install_requirements.bat
  4. Configured conf.yaml to reflect my pz_root and desired output_path
  5. Ran run.bat
  6. Encountered similar error as pasted below
  7. Ran run.bat a second time
  8. Encountered the error pasted below

OS: Windows 11 Pro (22H2) CPU: Ryzen 7 7800X3D GPU: RTX 4090 MEM: 32 GB DDR5 6000 Mhz Output Location: 4.0 TB M.2 SSD, ~3.3 TB free space before render Python Version: 3.10.6

job:[(21, 609, 152, [[1, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0]])] error, Exception:
job:[(22, 1634, 313, None)] error, Exception: cannot create im
Traceback (most recent call last): cache: 2472.00 MB
  File "C:\Users\tcd\OneDrive\Desktop\pzmap2dzi-main\pzmap2dzi\mptask.py", line 53, in _run
    result = self.worker.on_job(arg)
  File "C:\Users\tcd\OneDrive\Desktop\pzmap2dzi-main\pzmap2dzi\scheduling.py", line 297, in on_job
    self.dzi.render_tile(ic, self.render, x, y, layer)
  File "C:\Users\tcd\OneDrive\Desktop\pzmap2dzi-main\pzmap2dzi\pzdzi.py", line 378, in render_tile
    render.square(im_getter, ox, oy, sx, sy, layer)
  File "C:\Users\tcd\OneDrive\Desktop\pzmap2dzi-main\pzmap2dzi\render_impl\base.py", line 58, in square
    tex.render(im_getter.get(), ox, oy)
  File "C:\Users\tcd\OneDrive\Desktop\pzmap2dzi-main\pzmap2dzi\scheduling.py", line 220, in get
    raise Exception('cannot create im')
Exception: cannot create im
worker[2] error[cannot create im]6 cache: 2472.00 MB
Traceback (most recent call last):
  File "C:\Users\tcd\OneDrive\Desktop\pzmap2dzi-main\pzmap2dzi\mptask.py", line 53, in _run
    result = self.worker.on_job(arg)
  File "C:\Users\tcd\OneDrive\Desktop\pzmap2dzi-main\pzmap2dzi\scheduling.py", line 306, in on_job
    self.dzi.merge_tile(ic, level, x, y, layer, cached)
  File "C:\Users\tcd\OneDrive\Desktop\pzmap2dzi-main\pzmap2dzi\pzdzi.py", line 243, in merge_tile
    tile = Image.new('RGBA', (self.tile_size*2, self.tile_size*2))
  File "C:\Users\tcd\AppData\Local\Programs\Python\Python310\lib\site-packages\PIL\Image.py", line 2939, in new
    return im._new(core.fill(mode, size, color))
MemoryError
job: 1360820/1371044 worker: 0/16 cache: 2184.00 MB
time used 2:08:38.117907
cache max used: 3016.00 MB
Render stopped by hotkey.
All done

Finally, here are the two lines of conf.yaml that I touched (I did not change the mod_root to reflect my actual workshop path since the readme specifies "if you want to render a mod map" and I do not have any mod maps -- could this have caused the issue?):

pz_root: |- # project zomboid game folder
    C:\Games\Steam\steamapps\common\ProjectZomboid

output_path: |- # render output folder
    D:\Zomboid Map
cff29546 commented 9 months ago

You can try to turn off shared memory acceleration by setting enable_cache to false in conf.yaml, and see if that can help.

Tortoisecraft commented 9 months ago

That resolved it! Thank you very much for the help and the tool. :)