-
Notifications
You must be signed in to change notification settings - Fork 86
updating files and model for tf2 #16
base: master
Are you sure you want to change the base?
Conversation
tested it its working okay with tensorflow 2.5 and python v3.8 on aws lambda! |
Hi @Aretle have you witnessed this issue ? |
Hi, I have seen that type of output, even before updating the model for tf2. I always thought it was a prediction error. I've put a more detailed response in the issue thread. |
Hi @Aretle, First of all, this looks like a very cool package that can parse Australian addresses accurately (save for a few cases) I'm facing the same issue on my MacBook running macOS Big Sur 11.5.2. I have this conda environment setup:
Now, I ran This is very weird because as I was reading this thread, I assume this issue has already been fixed and I can see that you made changes to some Python files and adapted them to Tensorflow 2.x++ I think I'm doing something wrong here on my end, any help would be appreciated 😅 EDIT:I've also tried running
to install address-net version 1.0 from and tensorflow version 2.6.0 from pypi. However, I'm still getting the same error:
when I ran the sample code provided in this repository
|
Hi @blue2609, I think I understand your problem. As this commit is a fork for the adress-net package, trying to install address-net with pip and pypi will result in downloading the original branch that @jasonrig made which is the one stored on the Pypi index. That one that isn't updated for Tensorflow V2. This is the pull request to update that original repository. There are a couple of options for you. If you're able to use Tensorflow version 1, you can install address-net with pip and Tensorflow <= 1.15 I believe with: If you would like to use this version that will allow you to use later versions of Tensorflow and Pyython you could try something along the lines of: I hope this sheds some light on your problem and helps you out a bit. Let me know how it goes for you and I'll try help you out if you have anymore trouble. |
@Aretle first of all, please accept my apologies for not noticing this (badly needed) PR. I have been swamped with notifications from my day job and this never caught my attention. Let me check this over the coming week in view of getting it merged. |
@Aretle Hi mate, thanks so much for the help! Ah right I see, so the change hasn't been integrated to the main branch huh? That's alright, there's always a workaround like you said Aretle :) Following your suggestion, I managed to get
Now, after running the commands above, this is the list of packages installed in my conda virtual environment:
And below is my conda environment configuration
With this, I was able to run
with no problem :) |
Mate, I just want to say that your
to the address parser, it's going to output an error. This isn't the case with your RNN based address-net address parser as it can auto-correct typos and recognise the street address and street name automatically just from that string. Absolutely fantastic 👍 |
Glad you were able to get it working! Thankyou for sharing your process. I haven't tested this pull request with Tensorflow v1 so it definitely raises a good question as to how backwards compatible this update is. |
No stress at all! I just thought I'd leave a pull request so people could see it and use it if they needed to. Echoing what blue2609 said, you've done an awesome job on this package so I'm glad to possibly be able to contribute. Let me know if you have any questions or want me to walk you through the changes. I'm not sure about the backwards compatibility of this update, I think it will bring the lower limit version of Tensorflow up to a version I haven't checked. |
My personal feeling is that we can increment the major version number and not try to maintain backward compatibility. TF 1.x is old and ensuring backwards compatibility, especially when there are no new features (that is, the API is the same), seems like time not well spent. @Aretle since you retrained the model, it may cause slight changes to the output, and that maybe a bigger concern for others than TF backwards compatibility, since the output from the earlier version may not be 100% reproducible. This is not a problem in and of itself, but just another reason to include this as a major version increment alongside a release note to this effect. (Other things on my wishlist: CI/CD for testing combinations of python and TF versions, a QC dataset to verify that any retrained model isn't getting noticeably worse 😇 ... not going to happen in this PR, but I'll note it as an issue for anyone who may want to take it up) |
@jasonrig |
Summary
I updated the address-net files and model to work with Tensorflow v2.
The benefit of this is that you can now use Python v3.6-3.9 with address-net. Previously, as it was written with Tensorflow v1 in mind, support was only available for Python 3.6-3.7.
Corresponding issue: #11
Changes
The steps taken were to run the files through Tensorflow's automatic conversion script and then make a few manual changes. Finally, I retrained the address-net model using the same GNAF dataset (albeit for the most recent release). One minor change was to add "Place" entry into the lookups.py street abbreviations dictionary because I found it to be missing when I used the original version of address-net.
Further change will need to be made to the setup.py file to show support for the new Tensorflow version range if this pull request is accepted.
Testing
I tested it on Python v3.8 with Tensorflow v2.5 using the provided predict.py script.