I think this is the line that is causing the issue, you cannot pass the self instance to the constructor.
frame = F(self, container)
Can you please check and add more information to the question to understand what you are trying to achieve.
You can just add in __init__ one more argument, controller.
__init__
controller
This works for me:
def __init__(self, master, controller): tk.Frame.__init__(self, master)