google-deepmind / tree

tree is a library for working with nested data structures
https://tree.readthedocs.io
Apache License 2.0
938 stars 59 forks source link

dm-tree & tree #117

Open OSAMUYI-DAVID opened 7 months ago

OSAMUYI-DAVID commented 7 months ago

I am using python 3.12.0 with tensorflow 2.16.1 and keras 3.0.5 I've been trying my hands on ML & CNN. To aid my understanding, I copied some sample codes from some sites and, when I try executing them, I keep getting errors which indicate that the tree version I'm using is not the right one. Two such errors are: 'Module tree does not have the attribute flatten' and 'Module tree has no attribute map_structure' I began by doing the following:

  1. I did pip install dm-tree and the installation was successful
  2. Then I did import tree from within my program. My observation is as follows: The import in (2) does not use the dm-tree in (1) because the system keeps reporting 'Module tree does not have the attribute flatten'. But dm-tree surely contains the attribute 'flatten'. To confirm that the import in (2) is not using the dm-tree in (1), I did pip uninstall dm-tree, then import tree as in (2) above, and the system still carried out the import without reporting that module tree is missing. So, what is the sure-proof way of dealing with dm-tree and tree conflict? Thanks for any assistance.