wangzhecheng / DeepSolar

Nationwide houseshold-level solar panel identification with deep learning
MIT License
245 stars 72 forks source link

ImportError: No module named inception #23

Open namgivu opened 3 years ago

namgivu commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

namgivu commented 3 years ago

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 commented 2 years ago

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