First Run Error

28 views
Skip to first unread message

Sagar Patnaik

unread,
Jul 14, 2016, 10:27:04 AM7/14/16
to expresso-users
Hi

Even though the Expresso window starts-up and the drop down lists for selecting type of data, loading data are working perfectly fine, on selecting the cifar_t1.hdf5 file and pressing Open button, nothing happens. We are supposed to expect a notifiction on successful import and a name of the table in View/Select Table.

I also tried importing a folder of 2 images, but it too doesn't work and in both the cases I get the following on my terminal. Please help.

I am getting the following error on running the command " sh run_expresso.sh " :


/home/sagar/Downloads/expresso ROOT
/home/sagar/Downloads/expresso
/home/sagar/Downloads/expresso
/home/sagar/Downloads/expresso
0
reached here
/home/sagar/Downloads/expresso/data
.gitignore
test_iter: 100
test_interval: 1000
base_lr: 0.001
display: 200
max_iter: 60000
lr_policy: "fixed"
momentum: 0.9
weight_decay: 0.004
snapshot: 10000
snapshot_prefix: ""
solver_mode: GPU
net: ""


layer {
  name: "default"
  type: "HDF5Data"
  top: "data"
  top: "label"
  include {
    phase: TRAIN
  }
  transform_param {
  }
  hdf5_data_param {
    source: "train.txt"
    batch_size: 100
  }
}
layer {
  name: "default"
  type: "HDF5Data"
  top: "data"
  top: "label"
  include {
    phase: TEST
  }
  transform_param {
  }
  hdf5_data_param {
    source: "test.txt"
    batch_size: 100
  }
}


name: "Default"
input: "data"
input_dim: 64
input_dim: 1
input_dim: 28
input_dim: 28

IDX:  None
.gitignore
FIRST
Updating Checkable List Widget

Filling the comboBox for Models
/home/sagar/Downloads/expresso/res/data/help/helpBarData0.jpg
0
test_iter: 100
test_interval: 1000
base_lr: 0.001
display: 200
max_iter: 60000
lr_policy: "fixed"
momentum: 0.9
weight_decay: 0.004
snapshot: 10000
snapshot_prefix: ""
solver_mode: GPU
net: ""

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/graphicsItems/ImageItem.py", line 309, in paint
    self.render()
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/graphicsItems/ImageItem.py", line 301, in render
    argb, alpha = fn.makeARGB(image.transpose((1, 0, 2)[:image.ndim]), lut=lut, levels=self.levels)
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/functions.py", line 942, in makeARGB
    data = rescaleData(data, scale/(maxVal-minVal), minVal, dtype=int)
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/functions.py", line 828, in rescaleData
    d2 *= scale
TypeError: Cannot cast ufunc multiply output from dtype('float64') to dtype('int64') with casting rule 'same_kind'
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/graphicsItems/ImageItem.py", line 309, in paint
    self.render()
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/graphicsItems/ImageItem.py", line 301, in render
    argb, alpha = fn.makeARGB(image.transpose((1, 0, 2)[:image.ndim]), lut=lut, levels=self.levels)
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/functions.py", line 942, in makeARGB
    data = rescaleData(data, scale/(maxVal-minVal), minVal, dtype=int)
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/functions.py", line 828, in rescaleData
    d2 *= scale
TypeError: Cannot cast ufunc multiply output from dtype('float64') to dtype('int64') with casting rule 'same_kind'
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/graphicsItems/ImageItem.py", line 309, in paint
    self.render()
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/graphicsItems/ImageItem.py", line 301, in render
    argb, alpha = fn.makeARGB(image.transpose((1, 0, 2)[:image.ndim]), lut=lut, levels=self.levels)
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/functions.py", line 942, in makeARGB
    data = rescaleData(data, scale/(maxVal-minVal), minVal, dtype=int)
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/functions.py", line 828, in rescaleData
    d2 *= scale
TypeError: Cannot cast ufunc multiply output from dtype('float64') to dtype('int64') with casting rule 'same_kind'
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/graphicsItems/ImageItem.py", line 309, in paint
    self.render()
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/graphicsItems/ImageItem.py", line 301, in render
    argb, alpha = fn.makeARGB(image.transpose((1, 0, 2)[:image.ndim]), lut=lut, levels=self.levels)
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/functions.py", line 942, in makeARGB
    data = rescaleData(data, scale/(maxVal-minVal), minVal, dtype=int)
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/functions.py", line 828, in rescaleData
    d2 *= scale
TypeError: Cannot cast ufunc multiply output from dtype('float64') to dtype('int64') with casting rule 'same_kind'
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/graphicsItems/ImageItem.py", line 309, in paint
    self.render()
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/graphicsItems/ImageItem.py", line 301, in render
    argb, alpha = fn.makeARGB(image.transpose((1, 0, 2)[:image.ndim]), lut=lut, levels=self.levels)
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/functions.py", line 942, in makeARGB
    data = rescaleData(data, scale/(maxVal-minVal), minVal, dtype=int)
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/functions.py", line 828, in rescaleData
    d2 *= scale
TypeError: Cannot cast ufunc multiply output from dtype('float64') to dtype('int64') with casting rule 'same_kind'
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/graphicsItems/ImageItem.py", line 309, in paint
    self.render()
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/graphicsItems/ImageItem.py", line 301, in render
    argb, alpha = fn.makeARGB(image.transpose((1, 0, 2)[:image.ndim]), lut=lut, levels=self.levels)
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/functions.py", line 942, in makeARGB
    data = rescaleData(data, scale/(maxVal-minVal), minVal, dtype=int)
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/functions.py", line 828, in rescaleData
    d2 *= scale
TypeError: Cannot cast ufunc multiply output from dtype('float64') to dtype('int64') with casting rule 'same_kind'
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/graphicsItems/ImageItem.py", line 309, in paint
    self.render()
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/graphicsItems/ImageItem.py", line 301, in render
    argb, alpha = fn.makeARGB(image.transpose((1, 0, 2)[:image.ndim]), lut=lut, levels=self.levels)
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/functions.py", line 942, in makeARGB
    data = rescaleData(data, scale/(maxVal-minVal), minVal, dtype=int)
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/functions.py", line 828, in rescaleData
    d2 *= scale
TypeError: Cannot cast ufunc multiply output from dtype('float64') to dtype('int64') with casting rule 'same_kind'
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/graphicsItems/ImageItem.py", line 309, in paint
    self.render()
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/graphicsItems/ImageItem.py", line 301, in render
    argb, alpha = fn.makeARGB(image.transpose((1, 0, 2)[:image.ndim]), lut=lut, levels=self.levels)
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/functions.py", line 942, in makeARGB
    data = rescaleData(data, scale/(maxVal-minVal), minVal, dtype=int)
  File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/functions.py", line 828, in rescaleData
    d2 *= scale
TypeError: Cannot cast ufunc multiply output from dtype('float64') to dtype('int64') with casting rule 'same_kind'



Jaley Dholakiya

unread,
Jul 15, 2016, 3:20:49 PM7/15/16
to expresso-users
I experienced the same problem recently. It is because pyqtgraph has changed the way it deals with images. It now considers float as representation. I will send you updated git patch, and also change the source, if I find it a generic. However, can you tell me which version of ubuntu are you using?

Jaley Dholakiya

unread,
Jul 17, 2016, 1:21:42 PM7/17/16
to expresso-users
diff --git a/src/data/dataView.py b/src/data/dataView.py
index cb3030f..fd6cd57 100644
--- a/src/data/dataView.py
+++ b/src/data/dataView.py
@@ -105,7 +105,7 @@ class Ui_Form(QtGui.QWidget):
     self.img = pg.ImageItem(border='w')
     self.view.addItem(self.img)
     self.data = np.random.randint(255, size=(100, 100, 3))
-    self.img.setImage(self.data)
+    self.img.setImage(self.data.astype(np.float32))
     #Triggers
     self.tableWidgetData.itemChanged.connect(self.tableWidgetDataChanged)   
     self.tableWidgetData.itemSelectionChanged.connect(self.changeContent)
@@ -157,7 +157,7 @@ class Ui_Form(QtGui.QWidget):
         #Correction in image Starts
         self.data=np.fliplr(self.data.transpose(1,0))
         #Correction in image Ends
-        self.img.setImage(self.data)
+        self.img.setImage(self.data.astype(np.float32))
         if('label' in f.keys()):
         self.label_2.show()
         self.label_2.setText(str(f['label'][index]))
@@ -172,7 +172,7 @@ class Ui_Form(QtGui.QWidget):
     ### Correction in display ends
     data=data.astype('uint8')
     self.data=np.transpose(np.array(data),[1,2,0])
-        self.img.setImage(self.data)
+        self.img.setImage(self.data.astype(np.float32))
     if('label' in f.keys()):
         self.label_2.show()
         self.label_2.setText(str(f['label'][index]))
Reply all
Reply to author
Forward
0 new messages