I have built a model using keras and I can visualize it using keras visualizer, but I would like to change legend font size as it is too small in the resulting visualization. The code:
import visualkeras
from PIL import ImageFont
font = ImageFont.truetype("arial.ttf", 42, encoding="unic")
visualkeras.layered_view(model, spacing=5, font=font, legend=True, color_map=color_map)
The error I get when applying the third line in the code above:
font = ImageFont.truetype("arial.ttf", 42, encoding="unic")
Traceback (most recent call last):
File "<ipython-input-58-cde9b5409d9c>", line 1, in <module>
font = ImageFont.truetype("arial.ttf", 42, encoding="unic")
File "/home/idu/.local/lib/python3.6/site-packages/PIL/ImageFont.py", line 855, in truetype
return freetype(font)
File "/home/idu/.local/lib/python3.6/site-packages/PIL/ImageFont.py", line 852, in freetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
File "/home/idu/.local/lib/python3.6/site-packages/PIL/ImageFont.py", line 212, in __init__
font, size, index, encoding, layout_engine=layout_engine
OSError: cannot open resource
Is there a way to change legend font size while visualizing CNN layers using keras visualizer? Thank you!