AttributeError: 'gdstk.Cell' object has no attribute 'get_polygons' - python

I am new in PIC design and I want to make a simple GDSII design following this script:
https://github.com/BYUCamachoLab/simphony/blob/master/examples/layout_aware.py
which uses gdsfactory and simphony libraries but I consistently encounter this error when I am building a cell:
AttributeError: 'gdstk.Cell' object has no attribute 'get_polygons'
This problem appears when I try to call the grating coupler or the waveguides as a component. On the other hand, the Ybranch (splitters) work just fine.
I have downloaded all the latest versions of gdstk, gdsfactory and simphony but cannot make it work.
Do you know how to overcome this issue? What am I missing?
Thanks!

Solved. In case anybody finds in the same situation, the problem was with the gdstk library. For whatever reason, the version installed could not be changed and it remained always in 7.0.
By reinstalling Anaconda, the gdstk latest version could be installed without issues, and from there the program worked.

Related

An existing module in venv is not recognized by Pycharm

I am getting error for module dynamodb2 in boto but the module exists in my venv. Other modules in venv are recognized without any issues, only boto/dynamodb2 appears to have problem. I looked at similar issues posted on Stackoverflow such as this one python is not finding my installed modules in venv but none matched my situation. Any ideas what may be wrong?
It turned out to be an issue with Pycharm version I was using. I encountered above problem while using PyCharm community version 2022.2.2. I had an older PC where I did not get the library import error above. The version used was community 2020.2.4. So I installed the same on my new PC the error went away. Still don't quite understand why newer Pycharm would give the error and older version will not.

Cannot Unpickle my model after Reinstalling Python

I used pickle for a few months to save my ML-models and was able to load them without any problems but recently after Reinstalling Windows and Python I am getting this error message when I try to load the exact same model:
AttributeError: type object 'sklearn.neighbors.ball_tree.NeighborsHeap' has no attribute '__reduce_cython__'
Does anyone know what is causing this?
I used Python 3.6 (64bit) before and I am using the same one right now.
Most probably, you are using a different version of sklearn.
According to search results for __reduce_cython__ in Cython's codebase, it's added by Cython to some compiled types to make __reduce__ work correctly or something. So its absense likely means changes in the affected classes or their hierarchy.

'LookupAlignConvolution2d' no object '_convolution_op' attribute error

I have been working with the project tf-lcnn (https://github.com/ildoonet/tf-lcnn). I have built tensorflow from sources (1.4.1) and I am using python3 to run the command python3 train.py. This issue is that when I run said command I get:
AttributeError: 'LookupAlignConvolution2d' object has no attribute '_convolution_op'
I have tried tensorflow versions(1.3 and 1.4) and nothing gets the project to work. The custom_op was linked properly and works. The instructions from the project don't state that you have to follow his instructions first then build tensorflow. He also doesn't express the configuration build that he used.
I have tried some different approaches but I am sure there is something I am missing or doing wrong. Any help would be appreciated. I can post additional information upon request. Thanks in advance!

AttributeError: module 'tensorflow.contrib.rnn' has no attribute 'stack_bidirectional_dynamic_rnn'

I've just installed tensorflow-gpu (1.0) with pip on a new system (after installing cuda and cudnn, obviously).
Unfortunately, my code (working well on cpu with tensorflow 0.12), now throws
AttributeError: module 'tensorflow.contrib.rnn' has no attribute 'stack_bidirectional_dynamic_rnn'
When trying to call tf.contrib.rnn.stack_bidirectional_dynamic_rnn.
Moreover, the function is present in /path/to/python3.5/dist-packages/tensorflow/contrib/rnn/python/ops/rnn.py and seems to be imported in .../tensorflow/contrib/rnn/__init__.py.
Any ideas ?
P.S.: Downgrade to 0.12 (pip install tensorflow-gpu==0.12) resolve my issue, but that a bit disappointing :/
Oh, that's an error in the tensorflow code. Sorry about that. Please add an entry here listing ##stack_bidirectional_rnn here so that stack_bidirectional_rnn is exposed. Fix coming up. Feel free to open a github issue on our page and CC drpng there if you want to track progress.

Python 3 can only import astropy in some folders

I recently upgraded my python code to Python 3.4.2. I'm running Ubuntu 14.10.
I used a combination of pip3 and apt-get python3- to upgrade all my usual modules: numpy, scipy, astropy, ipython, matplotlib.
Importing all these modules usually works fine. Ipython runs, lists the correct python version number, etc etc. Numpy.version.version also gives me the correct version number.
My problem is that in one specific folder, import astropy throws a AttributeError: 'str' object has no attribute 'decode' in /usr/local/lib/python3.4/dist-packages/astropy/version.py.
In all other folders, import astropy works fine... What gives?
The decode error seems to point to a python2/python3 compatibility issue.
There must be some sort of environment variable problem in that folder, or a conflicting file in that folder? Can't seem to pin down a cause though..
This is a known issue: https://github.com/astropy/astropy/issues/3475
It will happen if you happen to be in an empty git repository (or your git is otherwise broken). There should be a new release out soon with a workaround to this.
Just to follow up, this issue should be resolved in Astropy v0.4.5: https://pypi.python.org/pypi/astropy/0.4.5

Categories

Resources