Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: No module named inception #23

Open
namgivu opened this issue Jun 2, 2021 · 5 comments
Open

ImportError: No module named inception #23

namgivu opened this issue Jun 2, 2021 · 5 comments

Comments

@namgivu
Copy link

namgivu commented Jun 2, 2021

I follow the README.md to run

python train_classification.py --fine_tune=False

and get the error

Traceback (most recent call last):
File "train_classification.py", line 17, in
from inception import inception_model as inception
ImportError: No module named inception

So how can I get the module inception available?

p.s.

I have google the error as this and this; but little helpful result found so I ask here.

@robban
Copy link

robban commented Jun 3, 2021

You need to add the inception library manually, however the link in the readme is dead. I would try the fms-santos branch instead that has added the inception folder already: https://github.com/fms-santos/DeepSolar/

@namgivu
Copy link
Author

namgivu commented Jun 3, 2021

You need to add the inception library manually, however the link in the readme is dead. I would try the fms-santos branch instead that has added the inception folder already: https://github.com/fms-santos/DeepSolar/

Thanks @robban ! Using fms-santos repo and it can run train_classification now

Though it leads to another error and I'm not sure what to fix next. Hope you would have a look.

Regards,
Nam

the error

ValueError: Shapes (2, 32, 1) and () are incompatible

in full

namgivu@localhost:~/code/b/deepsonar/zref/fms-santos--DeepSolar
$ ./.venv/bin/python train_classification.py --fine_tune=False
Training set built. Size: 0
Traceback (most recent call last):
  File "train_classification.py", line 262, in <module>
    train()
  File "train_classification.py", line 119, in train
    inception.loss(logits, labels, batch_size=BATCH_SIZE)
  File "/home/namgivu/code/b/deepsonar/zref/fms-santos--DeepSolar/inception/inception_model.py", line 128, in loss
    concated = tf.concat(1, [indices, sparse_labels])
  File "/home/namgivu/code/b/deepsonar/zref/fms-santos--DeepSolar/.venv/lib/python2.7/site-packages/tensorflow/python/ops/array_ops.py", line 1122, in concat
    tensor_shape.scalar())
  File "/home/namgivu/code/b/deepsonar/zref/fms-santos--DeepSolar/.venv/lib/python2.7/site-packages/tensorflow/python/framework/tensor_shape.py", line 848, in assert_is_compatible_with
    raise ValueError("Shapes %s and %s are incompatible" % (self, other))
ValueError: Shapes (2, 32, 1) and () are incompatible

@robban
Copy link

robban commented Jun 3, 2021

No guarantees, but you can try this patch and see if it helps:
patch.diff.txt

@namgivu
Copy link
Author

namgivu commented Jun 17, 2021

Hi @robban,
Sorry to reply late.

I tried your patch and get this error when running

python generate_data_list.py 
python train_classification.py --fine_tune=False

Hope you may have a look! Thanks a lot.

File "train_classification.py", line 263, in
train()
File "train_classification.py", line 201, in train
restorer.restore(sess, FLAGS.pretrained_model_checkpoint_path)
File "/home/namgivu/code/b/deepsolar/zref/fms-santos--DeepSolar/.venv/lib/python2.7/site-packages/tensorflow/python/platform/flags.py", line 85, in getattr
return wrapped.getattr(name)
File "/home/namgivu/code/b/deepsolar/zref/fms-santos--DeepSolar/.venv/lib/python2.7/site-packages/absl/flags/_flagvalues.py", line 481, in getattr
raise AttributeError(name)
AttributeError: pretrained_model_checkpoint_path

@bsedighi
Copy link

bsedighi commented Nov 29, 2021

Hello @namgivu
I am facing the same issue as you described (shapes ...... are incompatible)
can u tell me how you solved the issue?

Thank you in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants