Pysal issue module has no attribute 'open' - geospatial

I have an issue with the 'Pysal' library. I can successfully install Pysal and import it. However, whenever I use the function of Pysal , for example, opening a file by using 'open', then I will get an issue and it shows that 'module 'pysal' has no attribute 'open' '.Even I use other attributes instead of 'open', I will still get the issue. How should I fix it?

What version of pysal are you using? Please see the migration guide if using the latest release.
“pysal.open will change to pysal.lib.io.open”
https://github.com/pysal/pysal/blob/master/MIGRATING.md

Related

AttributeError: module 'torch' has no attribute 'inference_mode'

I am very new to pytorch, and when I try to run my CNN, I encountered the Error:
AttributeError: module 'torch' has no attribute 'inference_mode'.
Does anyone know what is going one? It worked on Google colab but no where else.
Try bump the version to 1.13. Reference: https://pytorch.org/docs/stable/generated/torch.inference_mode.html
Most likely its a version issue.
torch.inference_mode() was added recently in v1.9. Make sure you have the correct version.
Try printing torch.__version__ to check your version.

AttributeError: module 'tensorflow' has no attribute 'contrib'

I am using someone else code (Code Link) which is implemented in Tensorflow1. I want to run this code into Tensorflow2 However I am getting this error:
mnist = tf.contrib.learn.datasets.load_dataset("mnist")
AttributeError: module 'tensorflow' has no attribute 'contrib'
I upgraded this code by using this instruction:
!tf_upgrade_v2 \
--infile /research/dept8/gds/anafees/MyTest.py \
--outfile /research/dept8/gds/anafees/MyTest2.py
Most things are updated, however generated report showed:
168:21: ERROR: Using member tf.contrib.distribute.MirroredStrategy in deprecated module tf.contrib. tf.contrib.distribute.MirroredStrategy cannot be converted automatically. tf.contrib will not be distributed with TensorFlow 2.0, please consider an alternative in non-contrib TensorFlow, a community-maintained repository such as tensorflow/addons, or fork the required code.
I search google; however, I could not find any suitable solution. I do not want to move back to Tensorflow1. Is there any alternate solution? Can anyone help?
Few libraries are deprecated in Tensorflow 2.x such tf.contrib, To make the code compatible with Tf 2 needs some changes in library.
Replace
tf.contrib.learn.datasets.load_dataset("mnist")
with
tf.keras.datasets.mnist.load_data()
And Replace
tf.contrib.distribute.MirroredStrategy
with
tf.distribute.MirroredStrategy(devices=None, cross_device_ops=None)

Tensorboard: AttributeError: 'Model' object has no attribute '_get_distribution_strategy'

I'm getting this error when i use the tensorboard callback while training.
I tried looking for answers from posts related to tensorboard errors but this exact error was not found in any stackoverflow posts or github issues.
Please let know.
The following versions are installed in my pc:
Tensorflow and Tensorflow GPU : 2.0.0
Tensorboard: 2.0.0
I had the same problem and fixed it with this hack
model._get_distribution_strategy = lambda: None
It seems to be a bug on tensorflow's side.
https://github.com/tensorflow/tensorflow/pull/34870
Remove tensorboard callback for now.
This error mostly happens because of mixed imports from keras and tf.keras. Make sure that throughout the code exact referencing of libraries is maintained. For example instead of model.add(Conv2d()) try model.add(tf.keras.layers.Conv2D()) , applying this for all layers solved the problem for me.

module 'statsmodels.tsa.api' has no attribute 'arima_model'

I'm trying to use "statsmodels.api" to work with time series data and trying to fit a simple ARIMA model using
sm.tsa.arima_model.ARIMA(dta,(4,1,1)).fit()
but I got the following error
module 'statsmodels.tsa.api' has no attribute 'arima_model'
I'm using 'statsmodels' version 0.9.0 with 'spyder' version 3.2.8 I'd be pleased to get your help thanks
The correct path is :
import statsmodels.api as sm
sm.tsa.ARIMA()
You can view it using a shell that allows autocomplete like ipython.
It is also viewable in the example provided by statsmodels such as this one.
And more informations about package structure may be found here.

module 'tensorflow' has no attribute 'placeholder'

I am using Tensorflow version 1.3.0 and Tensorboard (0.1.8), and when I am using tf.placeholder(), tf.GLOBAL_VARIABLES() or tf.global_variables_initializer, it get an error like the one in the title. I know that there is an update in the function's syntax for this version, but I can't find what is wrong.
Can anyone help me?

Resources